summaryrefslogtreecommitdiffstats
path: root/src/plugins/tls
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2022-10-31 14:21:02 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2022-11-02 12:06:27 +0100
commit528b03d6b64cbcee14d9324f77588a102d57b57f (patch)
tree6a60d822fa5f2ffa8eb6dcf32b33c9c78bf9af99 /src/plugins/tls
parentc45cb7f0ccf4aba7973a8350f2d0ec832d2ba3ca (diff)
QSsl[OpenSSL/Android]: Fix hardcoded 1_1 suffix
Since we support 3 as well now we should not always use 1_1. The suffix will change depending on which OpenSSL version was used when Qt was built. This only affects Android. Pick-to: 6.4 6.2 5.15 Change-Id: I2e443b12daa5e79190f1b3367e21ba0fa6a1dcd4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/tls')
-rw-r--r--src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp b/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp
index 23be899dee..1cdeff2c23 100644
--- a/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp
+++ b/src/plugins/tls/openssl/qsslsocket_openssl_symbols.cpp
@@ -639,6 +639,12 @@ static QStringList findAllLibCrypto()
}
# endif
+#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
+
#ifdef Q_OS_WIN
struct LoadedOpenSsl {
@@ -670,12 +676,6 @@ static LoadedOpenSsl loadOpenSsl()
// 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"
#elif defined(Q_PROCESSOR_ARM_64)
@@ -692,7 +692,7 @@ static LoadedOpenSsl loadOpenSsl()
#undef QT_SSL_SUFFIX
return result;
}
-#else
+#else // !Q_OS_WIN:
struct LoadedOpenSsl {
std::unique_ptr<QLibrary> ssl, crypto;
@@ -771,7 +771,7 @@ static LoadedOpenSsl loadOpenSsl()
return suffix;
};
- static QString suffix = QString::fromLatin1(openSSLSuffix("_1_1"));
+ static QString suffix = QString::fromLatin1(openSSLSuffix("_" QT_OPENSSL_VERSION));
libssl->setFileNameAndVersion("ssl"_L1 + suffix, -1);
libcrypto->setFileNameAndVersion("crypto"_L1 + suffix, -1);