mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
fix alpn for http/2 upgrade when using DoH (#4182)
Signed-off-by: Johnny Bergström <johnny@klaudify.se>
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user