summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2018-11-28 19:20:52 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2018-11-29 08:18:44 +0000
commit2a494875b8f3d50046d35fb21988c288fcfa1dc7 (patch)
tree71331b72f884cc30340e31573a242bec39ac793a /src/network
parent7f6497e623fd66e0dc1ecab89ef16533154a6472 (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 2708c6c11d685ab25c12d558961d924c9a4533d2. Task-number: QTBUG-68156 Change-Id: I37cc060e90422779a6c29a324ab900f0fb99cfa7 Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp27
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 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<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
@@ -804,14 +804,23 @@ static QPair<QLibrary*, QLibrary*> 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