[server] Configure TLS next protos

This commit is contained in:
Ciprian Dorin Craciun 2019-08-15 10:41:08 +03:00
parent f96b3d72ad
commit 7019c78c2e

View file

@ -1089,6 +1089,7 @@ func main_0 () (error) {
PreferServerCipherSuites : true, PreferServerCipherSuites : true,
SessionTicketsDisabled : true, SessionTicketsDisabled : true,
DynamicRecordSizingDisabled : true, DynamicRecordSizingDisabled : true,
NextProtos : []string { "http/1.1", "http/1.0" },
} }
if _certificate, _error := tls.X509KeyPair ([]byte (DefaultTlsCertificatePublic), []byte (DefaultTlsCertificatePrivate)); _error == nil { if _certificate, _error := tls.X509KeyPair ([]byte (DefaultTlsCertificatePublic), []byte (DefaultTlsCertificatePrivate)); _error == nil {
@ -1133,7 +1134,7 @@ func main_0 () (error) {
_https2Server := & http.Server { _https2Server := & http.Server {
Handler : _server, Handler : _server,
TLSConfig : _tlsConfig.Clone (), TLSConfig : nil,
MaxHeaderBytes : _httpsServer.ReadBufferSize, 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 { if _timeoutDisabled {
_httpServer.ReadTimeout = 0 _httpServer.ReadTimeout = 0