private static List <SslCertBundle> DownloadCertBundles(UrlDownloaderConfig dlConfig)
        {
            List <SslCertBundle> sslCertBundles = new List <SslCertBundle>();
            List <string>        strs           = new List <string>();

            if (BattleNet.Client().GetMobileEnvironment() != constants.MobileEnv.PRODUCTION)
            {
                strs.Add("http://nydus-qa.web.blizzard.net/Bnet/zxx/client/bgs-key-fingerprint");
            }
            strs.Add("http://nydus.battle.net/Bnet/zxx/client/bgs-key-fingerprint");
            IUrlDownloader urlDownloader = BattleNet.Client().GetUrlDownloader();
            int            count         = strs.Count;

            foreach (string str in strs)
            {
                urlDownloader.Download(str, (bool success, byte[] bytes) => {
                    if (success)
                    {
                        SslCertBundle sslCertBundle = new SslCertBundle(bytes);
                        sslCertBundles.Add(sslCertBundle);
                    }
                    count--;
                }, dlConfig);
            }
            while (count > 0)
            {
                Thread.Sleep(15);
            }
            return(sslCertBundles);
        }
Exemplo n.º 2
0
        private static List <SslCertBundle> DownloadCertBundles(UrlDownloaderConfig dlConfig)
        {
            List <SslCertBundle> dlBundles = new List <SslCertBundle>();
            List <string>        list      = new List <string>();

            if (BattleNet.Client().GetMobileEnvironment() != constants.MobileEnv.PRODUCTION)
            {
                list.Add("http://nydus-qa.web.blizzard.net/Bnet/zxx/client/bgs-key-fingerprint");
            }
            list.Add("http://nydus.battle.net/Bnet/zxx/client/bgs-key-fingerprint");
            IUrlDownloader urlDownloader         = BattleNet.Client().GetUrlDownloader();
            int            numDownloadsRemaining = list.Count;

            foreach (string url in list)
            {
                urlDownloader.Download(url, delegate(bool success, byte[] bytes)
                {
                    if (success)
                    {
                        SslCertBundle item = new SslCertBundle(bytes);
                        dlBundles.Add(item);
                    }
                    numDownloadsRemaining--;
                }, dlConfig);
            }
            while (numDownloadsRemaining > 0)
            {
                Thread.Sleep(15);
            }
            return(dlBundles);
        }
Exemplo n.º 3
0
 public SslCertBundleSettings()
 {
     this.bundle = new SslCertBundle(null);
     this.bundleDownloadConfig = new UrlDownloaderConfig();
 }