From ba172a10765bb2a5474155675485848cb730e625 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 14 Apr 2011 11:24:05 +0200 Subject: HTTP+SSL: use default SSL configuration, and avoid setting it explctly do not use a null configuration, but a default configuration in QNetworkRequest by default. In addition, setting an SSL configuration explicitly will cause the on-demand loading of root certs to be disabled (because it could be that the user has set the CA certificates explicitly). Reviewed-by: Markus Goetz --- src/network/access/qhttpthreaddelegate.cpp | 2 +- src/network/access/qnetworkrequest.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp index 7a17a7f..8084078 100644 --- a/src/network/access/qhttpthreaddelegate.cpp +++ b/src/network/access/qhttpthreaddelegate.cpp @@ -267,7 +267,7 @@ void QHttpThreadDelegate::startRequest() #endif #ifndef QT_NO_OPENSSL // Set the QSslConfiguration from this QNetworkRequest. - if (ssl) { + if (ssl && incomingSslConfiguration != QSslConfiguration::defaultConfiguration()) { httpConnection->setSslConfiguration(incomingSslConfiguration); } #endif diff --git a/src/network/access/qnetworkrequest.cpp b/src/network/access/qnetworkrequest.cpp index 665ee28..338969a 100644 --- a/src/network/access/qnetworkrequest.cpp +++ b/src/network/access/qnetworkrequest.cpp @@ -524,7 +524,7 @@ void QNetworkRequest::setAttribute(Attribute code, const QVariant &value) QSslConfiguration QNetworkRequest::sslConfiguration() const { if (!d->sslConfiguration) - d->sslConfiguration = new QSslConfiguration; + d->sslConfiguration = new QSslConfiguration(QSslConfiguration::defaultConfiguration()); return *d->sslConfiguration; } -- cgit v0.12