mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 16:24:19 -04:00
support plain HTTP for DoH (#4997)
Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user