diff options
author | MÃ¥rten Nordheim <marten.nordheim@qt.io> | 2021-06-24 18:28:06 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-06-24 23:30:56 +0000 |
commit | 42c7b67cb493fb127bbe5e19ea7831ae5de2f1ea (patch) | |
tree | 3c400d11a885f08fe1986ffa14af979125aa3eee | |
parent | 517d42e4ce0f55a0517c57590a39121c8e113a03 (diff) |
tst_QSslSocket: Use supportedFeatures() instead of macro
It needs to be checked at runtime to know if the current backend
supports it
Change-Id: I0998309149b109e2075a008b2b8d8115fa3688cc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 773b37fb382059ff1deccc47251a907143b95f27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index d3d0110288..2a598661ac 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -211,9 +211,7 @@ private slots: void waitForMinusOne(); void verifyMode(); void verifyDepth(); -#if QT_CONFIG(openssl) void verifyAndDefaultConfiguration(); -#endif void disconnectFromHostWhenConnecting(); void disconnectFromHostWhenConnected(); #if QT_CONFIG(openssl) @@ -2611,12 +2609,13 @@ void tst_QSslSocket::verifyDepth() QCOMPARE(socket.peerVerifyDepth(), 1); } -#if QT_CONFIG(openssl) void tst_QSslSocket::verifyAndDefaultConfiguration() { QFETCH_GLOBAL(const bool, setProxy); if (setProxy) return; + if (!QSslSocket::supportedFeatures().contains(QSsl::SupportedFeature::CertificateVerification)) + QSKIP("This backend doesn't support manual certificate verification"); const auto defaultCACertificates = QSslConfiguration::defaultConfiguration().caCertificates(); const auto chainGuard = qScopeGuard([&defaultCACertificates]{ auto conf = QSslConfiguration::defaultConfiguration(); @@ -2646,7 +2645,6 @@ void tst_QSslSocket::verifyAndDefaultConfiguration() QCOMPARE(QSslConfiguration::defaultConfiguration().caCertificates(), QList{caCert}); #endif } -#endif // QT_CONFIG(openssl) void tst_QSslSocket::disconnectFromHostWhenConnecting() { |