From a8ad1451bd478758c96c924476f80e4e95661cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 18 Aug 2020 10:14:35 +0200 Subject: QNetworkReply(http): Ignore ssl errors in all reserved channels and not just the active one(s). When starting the connection with HTTP/2 and calling QNetworkReply::ignoreSslErrors() it would previously only ignore the errors in the single active channel that was used, but if we then fall back to HTTP/1.1 then we'll use the 5 other channels as well, and those would then fail due to the ignored ssl errors. Change-Id: I7aeb5b59897dd3a53579f0d38bd255bc2d97c2bb Reviewed-by: Timur Pocheptsov --- src/network/access/qhttpnetworkconnection.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/network/access/qhttpnetworkconnection.cpp') diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 3a5ce9c6c9..72abbb1521 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -1440,7 +1440,9 @@ void QHttpNetworkConnection::ignoreSslErrors(int channel) return; if (channel == -1) { // ignore for all channels - for (int i = 0; i < d->activeChannelCount; ++i) { + // We need to ignore for all channels, even the ones that are not in use just in case they + // will be in the future. + for (int i = 0; i < d->channelCount; ++i) { d->channels[i].ignoreSslErrors(); } @@ -1456,7 +1458,9 @@ void QHttpNetworkConnection::ignoreSslErrors(const QList &errors, int return; if (channel == -1) { // ignore for all channels - for (int i = 0; i < d->activeChannelCount; ++i) { + // We need to ignore for all channels, even the ones that are not in use just in case they + // will be in the future. + for (int i = 0; i < d->channelCount; ++i) { d->channels[i].ignoreSslErrors(errors); } -- cgit v1.2.3