diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2021-06-24 18:28:06 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2021-06-24 23:30:47 +0000 |
commit | 773b37fb382059ff1deccc47251a907143b95f27 (patch) | |
tree | 052cda9ba77b6ae6802003dc9e4a248f8bee3789 /tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp | |
parent | edc9a294a606e7eed3d7208f32193e0ec7eb0b9a (diff) |
tst_QSslSocket: Use supportedFeatures() instead of macro
It needs to be checked at runtime to know if the current backend
supports it
Pick-to: 6.2
Change-Id: I0998309149b109e2075a008b2b8d8115fa3688cc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp')
-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 475217b046..4669d10fa3 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -218,9 +218,7 @@ private slots: void waitForMinusOne(); void verifyMode(); void verifyDepth(); -#if QT_CONFIG(openssl) void verifyAndDefaultConfiguration(); -#endif void disconnectFromHostWhenConnecting(); void disconnectFromHostWhenConnected(); #if QT_CONFIG(openssl) @@ -2672,12 +2670,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(); @@ -2707,7 +2706,6 @@ void tst_QSslSocket::verifyAndDefaultConfiguration() QCOMPARE(QSslConfiguration::defaultConfiguration().caCertificates(), QList{caCert}); #endif } -#endif // QT_CONFIG(openssl) void tst_QSslSocket::disconnectFromHostWhenConnecting() { |