Skip to content

Commit feaea93

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 113f9dc + 0141dc2 commit feaea93

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

server/service/http.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,30 @@ func NewHttpServer(port string, eh events.Handler) *HttpServer {
5353
eh: eh,
5454
isTls: false,
5555
}
56-
s.server.Handler = s
56+
var protocols http.Protocols
57+
protocols.SetHTTP1(true)
58+
protocols.SetUnencryptedHTTP2(true)
59+
60+
s.server = &http.Server{
61+
Addr: fmt.Sprintf(":%v", port),
62+
Handler: s,
63+
Protocols: &protocols,
64+
}
5765
return s
5866
}
5967

6068
func NewHttpServerTls(port string, store *cert.Store, eh events.Handler) *HttpServer {
6169
s := NewHttpServer(port, eh)
6270
s.server.TLSConfig = &tls.Config{
6371
GetCertificate: store.GetCertificate,
72+
MinVersion: tls.VersionTLS12,
73+
MaxVersion: tls.VersionTLS13,
6474
}
75+
var protocols http.Protocols
76+
protocols.SetHTTP1(true)
77+
protocols.SetHTTP2(true)
78+
79+
s.server.Protocols = &protocols
6580
s.isTls = true
6681
return s
6782
}

0 commit comments

Comments
 (0)