public CustomsReportHandler() { var settingProvider = new CustomsReportSettingProvider(); _settings = settingProvider.GetCustomsReportSetting(); _reporter = new CustomsPaymentReport(); _customsReportDataProvider = new CustomsReportDataProvider(); }
private static HttpClientHandler GetCertificateHandler() { var handler = new WebRequestHandler(); var provider = new CustomsReportSettingProvider(); var setting = provider.GetCustomsReportSetting(); var key = GetCertCacheKey(setting.CertFilePath, setting.CertPassword); var certStream = CertCache.GetOrAdd(key, ReadCertFile(setting.CertFilePath)); X509Certificate2 cert = new X509Certificate2(certStream, setting.CertPassword); handler.ClientCertificates.Add(cert); return(handler); }