From f76ad7a3eb3557be0f091999277d3fa85c767d1f Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 14 Oct 2021 15:14:51 +0300 Subject: [PATCH] Remove loading certs from native Windows cert store. --- nel/src/web/curl_certificates.cpp | 41 ------------------------------- 1 file changed, 41 deletions(-) diff --git a/nel/src/web/curl_certificates.cpp b/nel/src/web/curl_certificates.cpp index fdf69604f..52f04fe25 100644 --- a/nel/src/web/curl_certificates.cpp +++ b/nel/src/web/curl_certificates.cpp @@ -131,13 +131,6 @@ namespace NLWEB // only use OpenSSL callback if not using Windows SSPI and using OpenSSL backend if (useOpenSSLBackend && !(data && data->features & CURL_VERSION_SSPI)) { -#ifdef NL_OS_WINDOWS - // load native Windows CA Certs - addCertificatesFrom("CA"); - addCertificatesFrom("AuthRoot"); - addCertificatesFrom("ROOT"); -#endif - isUsingOpenSSLBackend = true; } else @@ -179,40 +172,6 @@ namespace NLWEB return name; } -#ifdef NL_OS_WINDOWS - void addCertificatesFrom(LPCSTR root) - { - HCERTSTORE hStore; - PCCERT_CONTEXT pContext = NULL; - X509 *x509; - hStore = CertOpenSystemStore(NULL, root); - if (hStore) - { - while (pContext = CertEnumCertificatesInStore(hStore, pContext)) - { - x509 = NULL; - x509 = d2i_X509(NULL, (const unsigned char **)&pContext->pbCertEncoded, pContext->cbCertEncoded); - - if (x509) - { - CertEntry entry; - entry.cert = x509; - entry.file = root; - entry.name = getCertName(x509); - - CertList.push_back(entry); - } - } - - CertFreeCertificateContext(pContext); - CertCloseStore(hStore, 0); - } - - // this is called before debug context is set and log ends up in log.log - //nlinfo("Loaded %d certificates from '%s' certificate store", (int)CertList.size(), root); - } -#endif - void addCertificatesFromFile(const std::string &cert) { if (!isInitialized)