From 09e22c6c3280d4187b1ed2d979ceea478b7bed75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 11 Aug 2020 17:20:03 +0200 Subject: [PATCH] QNAM: Don't error out if the server doesn't support any ALPN we request If we ask for HTTP/2 or 1.1 and the server doesn't list either then we should still try to connect using HTTP/1(.1) just in case, to keep compatibility. Task-number: QTBUG-85902 Change-Id: I6ff2e38ac9d767e482a19ee4c81d101be37d3fab Reviewed-by: Timur Pocheptsov --- src/network/access/qhttpnetworkconnectionchannel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 24720be7da..a4e1ecb869 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -1190,8 +1190,7 @@ void QHttpNetworkConnectionChannel::_q_encrypted() // after establishing a secure connection we immediately start sending // HTTP/2 frames. switch (sslSocket->sslConfiguration().nextProtocolNegotiationStatus()) { - case QSslConfiguration::NextProtocolNegotiationNegotiated: - case QSslConfiguration::NextProtocolNegotiationUnsupported: { + case QSslConfiguration::NextProtocolNegotiationNegotiated: { QByteArray nextProtocol = sslSocket->sslConfiguration().nextNegotiatedProtocol(); if (nextProtocol == QSslConfiguration::NextProtocolHttp1_1) { // fall through to create a QHttpProtocolHandler @@ -1207,6 +1206,7 @@ void QHttpNetworkConnectionChannel::_q_encrypted() } } Q_FALLTHROUGH(); + case QSslConfiguration::NextProtocolNegotiationUnsupported: // No agreement, try HTTP/1(.1) case QSslConfiguration::NextProtocolNegotiationNone: { protocolHandler.reset(new QHttpProtocolHandler(this)); if (!sslConfiguration.data()) {