summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 25607dad88..073ad27a4b 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -249,9 +249,13 @@ bool QSslSocketBackendPrivate::initSslContext()
Q_Q(QSslSocket);
// If no external context was set (e.g. bei QHttpNetworkConnection) we will create a default context
- if (!sslContextPointer)
+ if (!sslContextPointer) {
+ // create a deep copy of our configuration
+ QSslConfigurationPrivate *configurationCopy = new QSslConfigurationPrivate(configuration);
+ configurationCopy->ref = 0; // the QSslConfiguration constructor refs up
sslContextPointer = QSharedPointer<QSslContext>(
- QSslContext::fromConfiguration(mode, QSslConfiguration(&configuration), allowRootCertOnDemandLoading));
+ QSslContext::fromConfiguration(mode, configurationCopy, allowRootCertOnDemandLoading));
+ }
if (sslContextPointer->error() != QSslError::NoError) {
q->setErrorString(sslContextPointer->errorString());