summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/network/ssl/qdtls/tst_qdtls.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/network/ssl/qdtls/tst_qdtls.cpp b/tests/auto/network/ssl/qdtls/tst_qdtls.cpp
index 6ca4ca9b92..6a94eee389 100644
--- a/tests/auto/network/ssl/qdtls/tst_qdtls.cpp
+++ b/tests/auto/network/ssl/qdtls/tst_qdtls.cpp
@@ -88,6 +88,7 @@ private slots:
void construction();
void configuration_data();
void configuration();
+ void invalidConfiguration();
void setPeer_data();
void setPeer();
void handshake_data();
@@ -310,6 +311,20 @@ void tst_QDtls::configuration()
}
}
+void tst_QDtls::invalidConfiguration()
+{
+ QUdpSocket socket;
+ QDtls crypto(QSslSocket::SslClientMode);
+ QVERIFY(crypto.setPeer(serverAddress, serverPort));
+ // Note: not defaultDtlsConfiguration(), so the protocol is TLS (without D):
+ QVERIFY(crypto.setDtlsConfiguration(QSslConfiguration::defaultConfiguration()));
+ QDTLS_VERIFY_NO_ERROR(crypto);
+ QCOMPARE(crypto.dtlsConfiguration(), QSslConfiguration::defaultConfiguration());
+ // Try to start the handshake:
+ QCOMPARE(crypto.doHandshake(&socket), false);
+ QCOMPARE(crypto.dtlsError(), QDtlsError::TlsInitializationError);
+}
+
void tst_QDtls::setPeer_data()
{
clientServerData();