From 69ff49e8f1885b48e14efdd5e58d3e780c63c727 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 4 Aug 2016 14:40:33 +0200 Subject: Enable cleartext HTTP/2 and bring the auto-test back to life HTTP/2 does not require TLS connection, it can work in a cleartext mode. Plus at the moment only OpenSSL backend allows HTTP/2 negotiation via ALPN/NPN (and none of our CI configurations with OpenSSL supports these extensions, rendering HTTP/2 auto-test useless). This patch implements cleartext HTTP/2 ('h2c') in 'direct' mode - this is allowed if a client has a prior knowledge that HTTP/2 is supported by a server. Change-Id: I4978775e9732c40bc77f549b83bb4a5d1761887e Reviewed-by: Alex Trotsenko Reviewed-by: Edward Welbourne --- src/network/access/qhttpthreaddelegate.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/network/access/qhttpthreaddelegate.cpp') diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp index e16519c2f2..1dca7f02fb 100644 --- a/src/network/access/qhttpthreaddelegate.cpp +++ b/src/network/access/qhttpthreaddelegate.cpp @@ -285,10 +285,11 @@ void QHttpThreadDelegate::startRequest() urlCopy.setPort(urlCopy.port(ssl ? 443 : 80)); QHttpNetworkConnection::ConnectionType connectionType - = QHttpNetworkConnection::ConnectionTypeHTTP; + = httpRequest.isHTTP2Allowed() ? QHttpNetworkConnection::ConnectionTypeHTTP2 + : QHttpNetworkConnection::ConnectionTypeHTTP; + #ifndef QT_NO_SSL if (httpRequest.isHTTP2Allowed() && ssl) { - connectionType = QHttpNetworkConnection::ConnectionTypeHTTP2; QList protocols; protocols << QSslConfiguration::ALPNProtocolHTTP2 << QSslConfiguration::NextProtocolHttp1_1; -- cgit v1.2.3