diff --git a/pkg/identity/b3.go b/pkg/identity/b3.go index fca494e5a..06472293c 100644 --- a/pkg/identity/b3.go +++ b/pkg/identity/b3.go @@ -60,7 +60,7 @@ func NewClient(baseURL, token string, caCert []byte, kc client.Reader) (*Client, return nil, err } // use InsecureSkipVerify, if IP address is used for baseURL host - if ip := net.ParseIP(u.Hostname()); ip != nil { + if ip := net.ParseIP(u.Hostname()); ip != nil && u.Scheme == "https" { customTransport := http.DefaultTransport.(*http.Transport).Clone() customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} c.client = &http.Client{Transport: customTransport}