Skip to content

Commit

Permalink
tst_QSslServer: check if SecureTransport will block the test
Browse files Browse the repository at this point in the history
which happens when we build with SDK 14 (where there is not property
for importing PKCS12 in memory only) and then run on macOS 15
(where our trick with a temporary keychain is not working anymore).

Task-number: QTBUG-130500
Pick-to: 6.8
Change-Id: I05845fa23dec70d48251f5e4d93084a574d67d92
Reviewed-by: Tor Arne Vestbø <[email protected]>
  • Loading branch information
Timur Pocheptsov committed Nov 7, 2024
1 parent feb39b2 commit c9d1f18
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/auto/network/ssl/qsslserver/tst_qsslserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <QtNetwork/QSslKey>
#include "private/qtlsbackend_p.h"

#include "../../../network-helpers.h"

class tst_QSslServer : public QObject
{
Q_OBJECT
Expand Down Expand Up @@ -125,6 +127,8 @@ QSslConfiguration tst_QSslServer::createQSslConfiguration(QString keyFileName,

void tst_QSslServer::testOneSuccessfulConnection()
{
if (QtNetworkTestHelpers::isSecureTransportBlockingTest())
QSKIP("SecureTransport will block this test while requesting keychain access");
// Setup server
QSslConfiguration serverConfiguration = selfSignedServerQSslConfiguration();
SslServerSpy server(serverConfiguration);
Expand Down Expand Up @@ -204,6 +208,8 @@ void tst_QSslServer::testOneSuccessfulConnection()

void tst_QSslServer::testSelfSignedCertificateRejectedByServer()
{
if (QtNetworkTestHelpers::isSecureTransportBlockingTest())
QSKIP("SecureTransport will block this test while requesting keychain access");
// Set up server that verifies client
QSslConfiguration serverConfiguration = selfSignedServerQSslConfiguration();
serverConfiguration.setPeerVerifyMode(QSslSocket::VerifyPeer);
Expand Down Expand Up @@ -257,6 +263,8 @@ void tst_QSslServer::testSelfSignedCertificateRejectedByServer()

void tst_QSslServer::testSelfSignedCertificateRejectedByClient()
{
if (QtNetworkTestHelpers::isSecureTransportBlockingTest())
QSKIP("SecureTransport will block this test while requesting keychain access");
// Set up server without verification of client
QSslConfiguration serverConfiguration = selfSignedServerQSslConfiguration();
SslServerSpy server(serverConfiguration);
Expand Down Expand Up @@ -490,6 +498,9 @@ void tst_QSslServer::quietClient()

void tst_QSslServer::twoGoodAndManyBadClients()
{
if (QtNetworkTestHelpers::isSecureTransportBlockingTest())
QSKIP("SecureTransport will block this test while requesting keychain access");

QSslConfiguration serverConfiguration = selfSignedServerQSslConfiguration();
SslServerSpy server(serverConfiguration);
server.server.setHandshakeTimeout(750);
Expand Down

0 comments on commit c9d1f18

Please sign in to comment.