diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2018-11-29 15:58:09 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2018-12-10 06:57:15 +0000 |
commit | 730dea58cfb2881e67e409b9ad0677485e2b3eb1 (patch) | |
tree | 8d359db09d42d500f103d6d008fbb1db1f58dbc7 | |
parent | b11ae750db4344f54948ea2bdd5dc8c8309d6c67 (diff) |
OpenSSL: also try the "1.0.2" soname
Turns out that also Debian patches OpenSSL 1.0, changing its soname to "1.0.2".
Therefore, try also to load that one.
Amends ec298193baae320410deac41e4884aa3474dcd6d.
Task-number: QTBUG-68156
Change-Id: I37cc060e90422779a6c29a324ab900f0fb99cfa7
(cherry picked from commit 2a494875b8f3d50046d35fb21988c288fcfa1dc7)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r-- | src/network/ssl/qsslsocket_openssl_symbols.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 6e920d5c81..8e290baa0b 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -669,7 +669,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl() // reason, we will search a few common paths (see findAllLibSsl() above) in hopes // we find one that works. // - // If that fails, for OpenSSL 1.0 we also try a fallback -- just look up + // If that fails, for OpenSSL 1.0 we also try some fallbacks -- look up // libssl.so with a hardcoded soname. The reason is QTBUG-68156: the binary // builds of Qt happen (at the time of this writing) on RHEL machines, // which change SHLIB_VERSION_NUMBER to a non-portable string. When running @@ -701,14 +701,23 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl() libcrypto->unload(); } - // first-and-half attempt: for OpenSSL 1.0 try to load an hardcoded soname. - libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String("1.0.0")); - libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String("1.0.0")); - if (libcrypto->load() && libssl->load()) { - return pair; - } else { - libssl->unload(); - libcrypto->unload(); + // first-and-half attempts: for OpenSSL 1.0 try to load some hardcoded sonames: + // - "1.0.0" is the official upstream one + // - "1.0.2" is found on some distributions (e.g. Debian) that patch OpenSSL + static const QLatin1String fallbackSonames[] = { + QLatin1String("1.0.0"), + QLatin1String("1.0.2") + }; + + for (auto fallbackSoname : fallbackSonames) { + libssl->setFileNameAndVersion(QLatin1String("ssl"), fallbackSoname); + libcrypto->setFileNameAndVersion(QLatin1String("crypto"), fallbackSoname); + if (libcrypto->load() && libssl->load()) { + return pair; + } else { + libssl->unload(); + libcrypto->unload(); + } } #endif |