Commit 383cc280 authored by Johnny Bergström's avatar Johnny Bergström Committed by GitHub

fix alpn for http/2 upgrade when using DoH (#4182)

Signed-off-by: default avatarJohnny Bergström <johnny@klaudify.se>
parent f2ec292e
...@@ -41,6 +41,9 @@ func NewServerHTTPS(addr string, group []*Config) (*ServerHTTPS, error) { ...@@ -41,6 +41,9 @@ func NewServerHTTPS(addr string, group []*Config) (*ServerHTTPS, error) {
if tlsConfig == nil { if tlsConfig == nil {
return nil, fmt.Errorf("DoH requires TLS to be configured, see the tls plugin") return nil, fmt.Errorf("DoH requires TLS to be configured, see the tls plugin")
} }
// http/2 is recommended when using DoH. We need to specify it in next protos
// or the upgrade won't happen.
tlsConfig.NextProtos = []string{"h2", "http/1.1"}
srv := &http.Server{ srv := &http.Server{
ReadTimeout: 5 * time.Second, ReadTimeout: 5 * time.Second,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment