Merge from remote branch

This commit is contained in:
yaling888
2021-07-03 22:31:12 +08:00
16 changed files with 28 additions and 75 deletions

View File

@ -3,7 +3,6 @@ package dns
import (
"bytes"
"context"
"crypto/tls"
"io/ioutil"
"net"
"net/http"
@ -76,7 +75,6 @@ func newDoHClient(url string, r *Resolver) *dohClient {
return &dohClient{
url: url,
transport: &http.Transport{
TLSClientConfig: &tls.Config{ClientSessionCache: globalSessionCache},
ForceAttemptHTTP2: true,
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
host, port, err := net.SplitHostPort(addr)

View File

@ -2,7 +2,6 @@ package dns
import (
"context"
"crypto/tls"
"errors"
"fmt"
"math/rand"
@ -20,10 +19,6 @@ import (
"golang.org/x/sync/singleflight"
)
var (
globalSessionCache = tls.NewLRUClientSessionCache(64)
)
type dnsClient interface {
Exchange(m *D.Msg) (msg *D.Msg, err error)
ExchangeContext(ctx context.Context, m *D.Msg) (msg *D.Msg, err error)

View File

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