summaryrefslogtreecommitdiffstats
path: root/tests/auto/qsslsocket_onDemandCertificates_static
diff options
context:
space:
mode:
authorPeter Hartmann <peter.hartmann@nokia.com>2011-03-24 10:50:15 (GMT)
committerPeter Hartmann <peter.hartmann@nokia.com>2011-03-28 15:18:31 (GMT)
commitaa144f7e11547549414a977f6e72ff8b92f95d30 (patch)
tree948a21247da2697a756497dba4079347642743db /tests/auto/qsslsocket_onDemandCertificates_static
parentd92c3ca977c62bdc0cc6d0961d4e2ae91cd5fc48 (diff)
downloadQt-aa144f7e11547549414a977f6e72ff8b92f95d30.zip
Qt-aa144f7e11547549414a977f6e72ff8b92f95d30.tar.gz
Qt-aa144f7e11547549414a977f6e72ff8b92f95d30.tar.bz2
QSslConfiguration: do not lazily construct the d-pointer
...the private class is cheap anyway; and lazy construction lead to problems like setting an empty default configuration would crash etc. Reviewed-by: Markus Goetz Task-number: QTBUG-17550
Diffstat (limited to 'tests/auto/qsslsocket_onDemandCertificates_static')
-rw-r--r--tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp b/tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
index 5003b5c..14a7c3b 100644
--- a/tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
+++ b/tests/auto/qsslsocket_onDemandCertificates_static/tst_qsslsocket_onDemandCertificates_static.cpp
@@ -218,6 +218,18 @@ void tst_QSslSocket_onDemandCertificates_static::onDemandRootCertLoadingStaticMe
this->socket = socket3;
socket3->connectToHostEncrypted(host, 443);
QVERIFY(!socket3->waitForEncrypted());
+
+ QSslSocket::setDefaultCaCertificates(QSslSocket::systemCaCertificates());
+
+ // setting empty default configuration -> should not work
+ QSslConfiguration conf;
+ QSslConfiguration originalDefaultConf = QSslConfiguration::defaultConfiguration();
+ QSslConfiguration::setDefaultConfiguration(conf);
+ QSslSocketPtr socket4 = newSocket();
+ this->socket = socket4;
+ socket4->connectToHostEncrypted(host, 443);
+ QVERIFY(!socket4->waitForEncrypted(4000));
+ QSslConfiguration::setDefaultConfiguration(originalDefaultConf); // restore old behaviour for run with proxies etc.
}
#endif // QT_NO_OPENSSL