From 2a494875b8f3d50046d35fb21988c288fcfa1dc7 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 28 Nov 2018 19:20:52 +0100 Subject: OpenSSL: also try the "1.0.2" soname MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Turns out that also Debian patches OpenSSL 1.0, changing its soname to "1.0.2". Therefore, try also to load that one. Amends 2708c6c11d685ab25c12d558961d924c9a4533d2. Task-number: QTBUG-68156 Change-Id: I37cc060e90422779a6c29a324ab900f0fb99cfa7 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Timur Pocheptsov --- src/network/ssl/qsslsocket_openssl_symbols.cpp | 27 +++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'src/network') diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 59c93677dd..2f8095cd81 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -771,7 +771,7 @@ static QPair 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 @@ -804,14 +804,23 @@ static QPair loadOpenSsl() } #if !QT_CONFIG(opensslv11) - // 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 #endif -- cgit v1.2.3