public EshopUtil(TitleDatabase db, X509Certificate2 certificate) { titleDatabase = db; webClient = new WebClient(); certWebClient = new CertificateWebClient(certificate); // client setup ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; ServicePointManager.ServerCertificateValidationCallback += delegate { return(true); }; // TODO SetupWebClient(webClient); SetupWebClient(certWebClient); }
public static async Task <XElement> GetECInfoForRegionAndTitleID(CertificateWebClient client, Region region, string eshopID) { string xmlString = await client.DownloadStringTaskAsync(NinjaUrl + String.Format(NinjaPath, region.ToCountryCode(), eshopID)); return(XDocument.Parse(xmlString).Root.Element("title_ec_info")); }