diff options
author | 2021-11-23 14:03:26 +0100 | |
---|---|---|
committer | 2021-11-23 14:03:26 +0100 | |
commit | b8439789f4d8dbcad0493ee96b5700605ce49e3a (patch) | |
tree | ac6c0c3e4a1b487292e98990ad3dabfba2c4bfbc /core | |
parent | 5f45ace89e0bb1d9120975d3d08e06dca8fa6dce (diff) | |
download | coredns-b8439789f4d8dbcad0493ee96b5700605ce49e3a.tar.gz coredns-b8439789f4d8dbcad0493ee96b5700605ce49e3a.tar.zst coredns-b8439789f4d8dbcad0493ee96b5700605ce49e3a.zip |
support plain HTTP for DoH (#4997)
Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/dnsserver/server_https.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/dnsserver/server_https.go b/core/dnsserver/server_https.go index 5962a5f09..b8bdbc66d 100644 --- a/core/dnsserver/server_https.go +++ b/core/dnsserver/server_https.go @@ -39,12 +39,12 @@ func NewServerHTTPS(addr string, group []*Config) (*ServerHTTPS, error) { // Should we error if some configs *don't* have TLS? tlsConfig = conf.TLSConfig } - if tlsConfig == nil { - 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"} + if tlsConfig != nil { + tlsConfig.NextProtos = []string{"h2", "http/1.1"} + } // Use a custom request validation func or use the standard DoH path check. var validator func(*http.Request) bool |