From 99023d40b640f426c01aae60e14462953276da5b Mon Sep 17 00:00:00 2001 From: Clifford Allan Jansen Date: Thu, 5 Dec 2013 16:04:47 +0000 Subject: QPID-5396: map confusing registry GUI name to its real name: Personal -> My git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1548180 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/client/windows/SslConnector.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/client/windows/SslConnector.cpp b/qpid/cpp/src/qpid/client/windows/SslConnector.cpp index a9d8a1d0df..4f4ef4f559 100644 --- a/qpid/cpp/src/qpid/client/windows/SslConnector.cpp +++ b/qpid/cpp/src/qpid/client/windows/SslConnector.cpp @@ -212,11 +212,15 @@ void SslConnector::loadPrivCertStore() // Get a handle to the system store or pkcs#12 file qpid::sys::ssl::SslOptions& opts = qpid::sys::ssl::SslOptions::global; if (opts.certFilename.empty()) { - // opening the system store - const char *store = opts.certStore.empty() ? "MY" : opts.certStore.c_str(); + // opening a system store, names are not case sensitive + std::string store = opts.certStore.empty() ? "my" : opts.certStore; + std::transform(store.begin(), store.end(), store.begin(), ::tolower); + // map confusing GUI name to actual registry store name + if (store == "personal") + store = "my"; certStore = ::CertOpenStore(CERT_STORE_PROV_SYSTEM_A, 0, NULL, CERT_STORE_OPEN_EXISTING_FLAG | CERT_STORE_READONLY_FLAG | - CERT_SYSTEM_STORE_CURRENT_USER, store); + CERT_SYSTEM_STORE_CURRENT_USER, store.c_str()); if (!certStore) { HRESULT status = GetLastError(); clientCertError.set(Msg() << "Could not open system certificate store: " << store, status); -- cgit v1.2.1