summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/shared/qopenssl_symbols.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/network/ssl/shared/qopenssl_symbols.h')
-rw-r--r--tests/auto/network/ssl/shared/qopenssl_symbols.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/auto/network/ssl/shared/qopenssl_symbols.h b/tests/auto/network/ssl/shared/qopenssl_symbols.h
index dff5bc8163..c98e90d424 100644
--- a/tests/auto/network/ssl/shared/qopenssl_symbols.h
+++ b/tests/auto/network/ssl/shared/qopenssl_symbols.h
@@ -1,6 +1,6 @@
// Copyright (C) 2021 The Qt Company Ltd.
// Copyright (C) 2014 BlackBerry Limited. All rights reserved.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
/****************************************************************************
**
@@ -481,7 +481,7 @@ QStringList findAllLibs(QLatin1String filter)
QStringList entryList = dir.entryList(filters, QDir::Files);
std::sort(entryList.begin(), entryList.end(), LibGreaterThan());
- for (const QString &entry : qAsConst(entryList))
+ for (const QString &entry : std::as_const(entryList))
found << path + QLatin1Char('/') + entry;
}
@@ -502,6 +502,12 @@ QStringList findAllLibCrypto()
#ifdef Q_OS_WIN
+#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
+
struct LoadedOpenSsl {
std::unique_ptr<QSystemLibrary> ssl, crypto;
};
@@ -540,8 +546,9 @@ 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;