From 7019c78c2ef30fd9af13bcf9198da2a22a34c30f Mon Sep 17 00:00:00 2001 From: Ciprian Dorin Craciun Date: Thu, 15 Aug 2019 10:41:08 +0300 Subject: [PATCH] [server] Configure TLS next protos --- sources/cmd/server/server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sources/cmd/server/server.go b/sources/cmd/server/server.go index 823a2d6..ba4b431 100644 --- a/sources/cmd/server/server.go +++ b/sources/cmd/server/server.go @@ -1089,6 +1089,7 @@ func main_0 () (error) { PreferServerCipherSuites : true, SessionTicketsDisabled : true, DynamicRecordSizingDisabled : true, + NextProtos : []string { "http/1.1", "http/1.0" }, } if _certificate, _error := tls.X509KeyPair ([]byte (DefaultTlsCertificatePublic), []byte (DefaultTlsCertificatePrivate)); _error == nil { @@ -1133,7 +1134,7 @@ func main_0 () (error) { _https2Server := & http.Server { Handler : _server, - TLSConfig : _tlsConfig.Clone (), + TLSConfig : nil, MaxHeaderBytes : _httpsServer.ReadBufferSize, @@ -1144,6 +1145,9 @@ func main_0 () (error) { } + _https2Server.TLSConfig = _tlsConfig.Clone () + _https2Server.TLSConfig.NextProtos = []string { "h2", "http/1.1", "http/1.0" } + if _timeoutDisabled { _httpServer.ReadTimeout = 0