summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-09-17 13:10:55 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2021-09-21 15:49:44 +0200
commitfcf236370b64408720bc65ea221143ed7f3f6b3f (patch)
treefe16e23865874708e874ab31e61d88fefed79fd2
parent53f2f2a4b0c7b166e8e7e0950454dd44bc08b253 (diff)
Fix loading of OpenSSL on macOS versions that ship its own OpenSSL
The unversioned libcrypto.dylib that's shipped with macOS 10.15 will result in a crash if loaded, with a message saying that the unversioned library should not be loaded, as it doesn't provide a stable ABI. Task-number: QTBUG-95249 Change-Id: I49325e5d675155e90840cc93623549f725bc77b4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit c70bb357cce860385ea8c61b337f24165fa04db6) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index aad8560a0c..5b15da64b5 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -794,6 +794,11 @@ static LoadedOpenSsl loadOpenSsl()
const QStringList cryptoList = findAllLibCrypto();
for (const QString &crypto : cryptoList) {
+#ifdef Q_OS_DARWIN
+ // Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI
+ if (crypto.endsWith("libcrypto.dylib"))
+ continue;
+#endif
libcrypto->setFileNameAndVersion(crypto, -1);
if (libcrypto->load()) {
QFileInfo fi(crypto);