diff --git a/NetSSL_Win/src/Context.cpp b/NetSSL_Win/src/Context.cpp index c9ff25a63..dcb44d3c9 100644 --- a/NetSSL_Win/src/Context.cpp +++ b/NetSSL_Win/src/Context.cpp @@ -167,7 +167,7 @@ void Context::loadCertificate() if (!_hCertStore) { if (_options & OPT_USE_MACHINE_STORE) - _hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, _certStoreName.c_str()); + _hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, wcertStoreName.c_str()); else _hCertStore = CertOpenSystemStoreW(0, wcertStore.c_str()); } diff --git a/NetSSL_Win/src/X509Certificate.cpp b/NetSSL_Win/src/X509Certificate.cpp index bb8f5166f..60a99d87d 100644 --- a/NetSSL_Win/src/X509Certificate.cpp +++ b/NetSSL_Win/src/X509Certificate.cpp @@ -366,7 +366,7 @@ void X509Certificate::loadCertificate(const std::string& certName, const std::st Poco::UnicodeConverter::convert(certStoreName, wcertStore); HCERTSTORE hCertStore; if (useMachineStore) - hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, certStoreName.c_str()); + hCertStore = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, wcertStoreName.c_str()); else hCertStore = CertOpenSystemStoreW(0, wcertStore.c_str());