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 --- tests/auto/network/access/http2/http2srv.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tests/auto/network/access/http2/http2srv.h') diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h index 00cfde944b..8d02ae60ef 100644 --- a/tests/auto/network/access/http2/http2srv.h +++ b/tests/auto/network/access/http2/http2srv.h @@ -33,9 +33,9 @@ #include #include +#include #include #include -#include #include #include @@ -62,7 +62,7 @@ class Http2Server : public QTcpServer { Q_OBJECT public: - Http2Server(const Http2Settings &serverSettings, + Http2Server(bool clearText, const Http2Settings &serverSettings, const Http2Settings &clientSettings); ~Http2Server(); @@ -105,7 +105,7 @@ Q_SIGNALS: void windowUpdate(quint32 streamID); private slots: - void connectionEncrypted(); + void connectionEstablished(); void readReady(); private: @@ -113,7 +113,7 @@ private: quint32 clientSetting(Http2::Settings identifier, quint32 defaultValue); - QScopedPointer socket; + QScopedPointer socket; // Connection preface: bool waitingClientPreface = false; @@ -155,6 +155,7 @@ private: quint32 streamRecvWindowSize = Http2::defaultSessionWindowSize; QByteArray responseBody; + bool clearTextHTTP2 = false; protected slots: void ignoreErrorSlot(); -- cgit v1.2.3