summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkconnectionchannel.cpp
diff options
context:
space:
mode:
authorVladimir Prus <vladimir.prus@gmail.com>2015-11-20 11:20:02 +0300
committerAndré Klitzing <aklitzing@gmail.com>2016-10-05 19:46:51 +0000
commit840e2dd2f04a32120e2ca450fba6f79b06ca2515 (patch)
treea5cea47bb435bc228d6d21bb6932c7c075607ce3 /src/network/access/qhttpnetworkconnectionchannel.cpp
parentdc737fa0d77a7549396efcf9ffa6e917dd40595f (diff)
Make sure SSL configuration is correct in QNetworkReply::encrypted.
In some cases, when QNetworkReply::encrypted is emitted, QNetworkReply::sslConfiguration is not yet initialized, in particular certificate chain is empty, which breaks the documented usage of 'encrypted' to perform additional checks on certificate chain. It looks to be caused by the fact that QHttpNetworkReply is originally associated with 0th QHttpNetworkConnectionChannel, and this association is not updated if HTTP pipelining is not used. Therefore, a reply on channel >0 might arrive before reply on channel 0, and then using ssl configuration from channel 0, which not made it through handshake, is not usable. Task-number: QTBUG-49554 Change-Id: Ie5d4b5a0c503d5bdc44761ce8581f6ffe4e3bac2 Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
Diffstat (limited to 'src/network/access/qhttpnetworkconnectionchannel.cpp')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index dfa5d0e74a..946df8d8f9 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -1070,6 +1070,7 @@ void QHttpNetworkConnectionChannel::_q_encrypted()
connection->d_func()->dequeueRequest(socket);
if (reply) {
reply->setSpdyWasUsed(false);
+ Q_ASSERT(reply->d_func()->connectionChannel == this);
emit reply->encrypted();
}
if (reply)
@@ -1109,8 +1110,6 @@ void QHttpNetworkConnectionChannel::_q_sslErrors(const QList<QSslError> &errors)
connection->d_func()->pauseConnection();
if (pendingEncrypt && !reply)
connection->d_func()->dequeueRequest(socket);
- if (reply) // a reply was actually dequeued.
- reply->d_func()->connectionChannel = this; // set correct channel like in sendRequest() and queueRequest();
if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP) {
if (reply)
emit reply->sslErrors(errors);