Fix: ALPN should on DoH instead of DoT (#2232)

This commit is contained in:
gVisor bot 2022-07-25 12:41:22 +08:00
parent fcf90d63d3
commit 44a1ae08ef
2 changed files with 5 additions and 2 deletions

View file

@ -3,6 +3,7 @@ package dns
import (
"bytes"
"context"
"crypto/tls"
"io"
"net"
"net/http"
@ -102,6 +103,10 @@ func newDoHClient(url, iface string, r *Resolver) *dohClient {
return dialer.DialContext(ctx, "tcp", net.JoinHostPort(ip.String(), port), options...)
},
TLSClientConfig: &tls.Config{
// alpn identifier, see https://tools.ietf.org/html/draft-hoffman-dprive-dns-tls-alpn-00#page-6
NextProtos: []string{"dns"},
},
},
}
}

View file

@ -63,8 +63,6 @@ func transform(servers []NameServer, resolver *Resolver) []dnsClient {
Client: &D.Client{
Net: s.Net,
TLSConfig: &tls.Config{
// alpn identifier, see https://tools.ietf.org/html/draft-hoffman-dprive-dns-tls-alpn-00#page-6
NextProtos: []string{"dns"},
ServerName: host,
},
UDPSize: 4096,