Skip to content

Commit

Permalink
QNAM: Don't error out if the server doesn't support any ALPN we request
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Morten242 committed Aug 13, 2020
1 parent 1a8627c commit 09e22c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/network/access/qhttpnetworkconnectionchannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()) {
Expand Down

0 comments on commit 09e22c6

Please sign in to comment.