summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2018-12-13 15:39:26 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2019-06-13 04:16:09 +0000
commit2e7b7e4c90882cef50b293fe8048205a9ca7e5a9 (patch)
tree32ee784ab947d958d1855766b67b76941f71fbeb /tests
parent90aefe0843a50aede26b8d411f46f3828dae25f1 (diff)
QSslSocket: add and set the TLSv1.3-specific PSK callback
If this callback is not set then OpenSSL will call the callback used for <= TLS 1.2 unconditionally when connecting. If using PSK it will call it again later once the preshared key is needed. We don't currently handle the TLSv1.3 PSK, but we definitely should. But for now we can work around it - when psk_use_session_callback is called we simply change the PSK callback to a dummy function whose only purpose is to restore the old callback. This is mostly done to keep behavior the same as it is now for users (and to keep our tests running). Later we can add a new signal and handle this new feature properly. Reviewed-by: Simo Fält <simo.falt@qt.io> (cherry picked from commit d8efc8d718e3b3a0464f321e740541f5b221a5d6) Task-number: QTBUG-67463 Change-Id: I4aca4ae73ec4be7c4f82a85e8864de103f35a834 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index 1c27901844..b4dc9bed33 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -3546,12 +3546,7 @@ protected:
socket = new QSslSocket(this);
socket->setSslConfiguration(config);
socket->setPeerVerifyMode(peerVerifyMode);
- if (QSslSocket::sslLibraryVersionNumber() > 0x10101000L) {
- // FIXME. With OpenSSL 1.1.1 and TLS 1.3 PSK auto-test is broken.
- socket->setProtocol(QSsl::TlsV1_2);
- } else {
- socket->setProtocol(protocol);
- }
+ socket->setProtocol(protocol);
if (ignoreSslErrors)
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
@@ -3895,11 +3890,6 @@ void tst_QSslSocket::pskServer()
return;
QSslSocket socket;
-#ifdef TLS1_3_VERSION
- // FIXME: with OpenSSL 1.1.1 (thus TLS 1.3) test is known to fail
- // due to the different PSK mechanism (?) - to be investigated ASAP.
- socket.setProtocol(QSsl::TlsV1_2);
-#endif
this->socket = &socket;
QSignalSpy connectedSpy(&socket, SIGNAL(connected()));