From a64b57e2fbd90430045628694e8bcf6abf246ab2 Mon Sep 17 00:00:00 2001 From: Simon Kirillov Date: Sat, 10 Apr 2021 09:09:22 +0700 Subject: [PATCH] control/controlclient: create tls client config with server hostname instead of serverURL.Host Signed-off-by: Simon Kirillov --- control/controlclient/direct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index 347620df3..12f861fea 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -144,7 +144,7 @@ func NewDirect(opts Options) (*Direct, error) { tr := http.DefaultTransport.(*http.Transport).Clone() tr.Proxy = tshttpproxy.ProxyFromEnvironment tshttpproxy.SetTransportGetProxyConnectHeader(tr) - tr.TLSClientConfig = tlsdial.Config(serverURL.Host, tr.TLSClientConfig) + tr.TLSClientConfig = tlsdial.Config(serverURL.Hostname(), tr.TLSClientConfig) tr.DialContext = dnscache.Dialer(dialer.DialContext, dnsCache) tr.DialTLSContext = dnscache.TLSDialer(dialer.DialContext, dnsCache, tr.TLSClientConfig) tr.ForceAttemptHTTP2 = true