summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslsocket_opensslpre11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/ssl/qsslsocket_opensslpre11.cpp')
-rw-r--r--src/network/ssl/qsslsocket_opensslpre11.cpp20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/network/ssl/qsslsocket_opensslpre11.cpp b/src/network/ssl/qsslsocket_opensslpre11.cpp
index 062e03f4e6..f5aab821ea 100644
--- a/src/network/ssl/qsslsocket_opensslpre11.cpp
+++ b/src/network/ssl/qsslsocket_opensslpre11.cpp
@@ -215,8 +215,6 @@ bool QSslSocketPrivate::ensureLibraryLoaded()
QMutexLocker locker(openssl_locks()->initLock());
if (!s_libraryLoaded) {
- s_libraryLoaded = true;
-
// Initialize OpenSSL.
q_CRYPTO_set_id_callback(id_function);
q_CRYPTO_set_locking_callback(locking_function);
@@ -235,6 +233,8 @@ bool QSslSocketPrivate::ensureLibraryLoaded()
qWarning("Random number generator not seeded, disabling SSL support");
return false;
}
+
+ s_libraryLoaded = true;
}
return true;
}
@@ -251,21 +251,7 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
#if QT_CONFIG(library)
//load symbols needed to receive certificates from system store
-#if defined(Q_OS_WIN)
- HINSTANCE hLib = LoadLibraryW(L"Crypt32");
- if (hLib) {
- ptrCertOpenSystemStoreW = reinterpret_cast<PtrCertOpenSystemStoreW>(
- reinterpret_cast<QFunctionPointer>(GetProcAddress(hLib, "CertOpenSystemStoreW")));
- ptrCertFindCertificateInStore = reinterpret_cast<PtrCertFindCertificateInStore>(
- reinterpret_cast<QFunctionPointer>(GetProcAddress(hLib, "CertFindCertificateInStore")));
- ptrCertCloseStore = reinterpret_cast<PtrCertCloseStore>(
- reinterpret_cast<QFunctionPointer>(GetProcAddress(hLib, "CertCloseStore")));
- if (!ptrCertOpenSystemStoreW || !ptrCertFindCertificateInStore || !ptrCertCloseStore)
- qCWarning(lcSsl, "could not resolve symbols in crypt32 library"); // should never happen
- } else {
- qCWarning(lcSsl, "could not load crypt32 library"); // should never happen
- }
-#elif defined(Q_OS_QNX)
+#if defined(Q_OS_QNX)
s_loadRootCertsOnDemand = true;
#elif defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
// check whether we can enable on-demand root-cert loading (i.e. check whether the sym links are there)