summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2018-05-09 12:50:59 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2018-05-11 08:42:17 +0000
commit5134ff882a5b62a692a330a57f135870eccfa2b5 (patch)
tree7d84baf1ee8f7cfc34ef710cdc5b5b119cda826f /tests/auto
parent68e6d64fe36511d0d9d8004e7fc1c36bf6c26ed2 (diff)
OpenSSL v1.1.1: fix qtbug18498_peek
Previously the test worked because the client was the last party to know when encryption was established. However, due to changes in the TLSv1.3 handshake the server is now the last one. In either case, relying on both to be encrypted when one of them is finished is not great, so now we only quit the event loop when both client and server have emitted 'encrypted'. Change-Id: Ic1fc75671206d866f7ea983805fd58a99657aac6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index de759ae051..e32fa7c724 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -2838,11 +2838,19 @@ void tst_QSslSocket::qtbug18498_peek()
client->setObjectName("client");
client->ignoreSslErrors();
- connect(client, SIGNAL(encrypted()), this, SLOT(exitLoop()));
+ int encryptedCounter = 2;
+ connect(client, &QSslSocket::encrypted, this, [&encryptedCounter, this](){
+ if (!--encryptedCounter)
+ exitLoop();
+ });
+ WebSocket *serversocket = server.socket;
+ connect(serversocket, &QSslSocket::encrypted, this, [&encryptedCounter, this](){
+ if (!--encryptedCounter)
+ exitLoop();
+ });
connect(client, SIGNAL(disconnected()), this, SLOT(exitLoop()));
client->startClientEncryption();
- WebSocket *serversocket = server.socket;
QVERIFY(serversocket);
serversocket->setObjectName("server");