diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-10-20 23:00:27 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2018-10-20 23:19:30 +0000 |
commit | 9ef793ba9539b4eddb7893c0df9be6e211d9984f (patch) | |
tree | 7b9374b8dcc8cbbc3b92636b2029f1b55c5e3194 /src/network/ssl/qsslsocket_openssl_symbols.cpp | |
parent | e631e900fd0cd7467b1dccb5fa401afdcd1e41a8 (diff) | |
parent | 7a252ac46780b6145084d8d5ca0549b2de3639cc (diff) |
Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12
Diffstat (limited to 'src/network/ssl/qsslsocket_openssl_symbols.cpp')
-rw-r--r-- | src/network/ssl/qsslsocket_openssl_symbols.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index 8af9b5d77e..5482440b98 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -821,6 +821,17 @@ 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 + // 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 + // those binaries on the target systems, this code won't pick up + // libssl.so.MODIFIED_SHLIB_VERSION_NUMBER because it doesn't exist there. + // Given that the only 1.0 supported release (at the time of this writing) + // is 1.0.2, with soname "1.0.0", give that a try too. Note that we mandate + // OpenSSL >= 1.0.0 with a configure-time check, and OpenSSL has kept binary + // compatibility between 1.0.0 and 1.0.2. + // // It is important, however, to try the canonical name and the unversioned name // without going through the loop. By not specifying a path, we let the system // dlopen(3) function determine it for us. This will include any DT_RUNPATH or @@ -841,6 +852,18 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl() libssl->unload(); libcrypto->unload(); } + +#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(); + } +#endif #endif #ifndef Q_OS_DARWIN |