summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMÃ¥rten Nordheim <marten.nordheim@qt.io>2021-10-12 15:01:08 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-10-18 04:12:06 +0000
commita3bd4cd8bc7815303f8409d07df0321f2a8cf785 (patch)
tree754a8738afd62c7ff74b9c7e2e70615fb5e3830d /src
parentd16e68f20f0e2739f80ce4ebccd9761686bff544 (diff)
QOpenSSLBackend: Properly load 3.0 when compiled with 3.0
The naming updated but the version suffix is hardcoded on windows and it was overlooked when work was done to support OpenSSL 3. Fixes: QTBUG-97116 Change-Id: Iec15d772c54ed214940ec5634a0929485478f771 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit ed3e1ecb2797651c64a7bb88c2c73e83e212190e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp b/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp
index 037ab92f62..d6df1a0286 100644
--- a/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp
+++ b/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp
@@ -700,7 +700,14 @@ static LoadedOpenSsl loadOpenSsl()
LoadedOpenSsl result;
// With OpenSSL 1.1 the names have changed to libssl-1_1 and libcrypto-1_1 for builds using
- // MSVC and GCC, with architecture suffixes for non-x86 builds.
+ // MSVC and GCC. For 3.0 the version suffix changed again, to just '3'.
+ // For non-x86 builds, an architecture suffix is also appended.
+
+#if (OPENSSL_VERSION_NUMBER >> 28) < 3
+#define QT_OPENSSL_VERSION "1_1"
+#elif OPENSSL_VERSION_MAJOR == 3 // Starting with 3.0 this define is available
+#define QT_OPENSSL_VERSION "3"
+#endif // > 3 intentionally left undefined
#if defined(Q_PROCESSOR_X86_64)
#define QT_SSL_SUFFIX "-x64"
@@ -712,8 +719,8 @@ static LoadedOpenSsl loadOpenSsl()
#define QT_SSL_SUFFIX
#endif
- tryToLoadOpenSslWin32Library(QLatin1String("libssl-1_1" QT_SSL_SUFFIX),
- QLatin1String("libcrypto-1_1" QT_SSL_SUFFIX), result);
+ tryToLoadOpenSslWin32Library(QLatin1String("libssl-" QT_OPENSSL_VERSION QT_SSL_SUFFIX),
+ QLatin1String("libcrypto-" QT_OPENSSL_VERSION QT_SSL_SUFFIX), result);
#undef QT_SSL_SUFFIX
return result;