diff --git a/api/api.go b/api/api.go index 1353979df..6f90ed5d6 100644 --- a/api/api.go +++ b/api/api.go @@ -430,17 +430,20 @@ func NewClient(config *Config) (*Client, error) { // NewHttpClient returns an http client configured with the given Transport and TLS // config. func NewHttpClient(transport *http.Transport, tlsConf TLSConfig) (*http.Client, error) { - tlsClientConfig, err := SetupTLSConfig(&tlsConf) - - if err != nil { - return nil, err - } - - transport.TLSClientConfig = tlsClientConfig client := &http.Client{ Transport: transport, } + if transport.TLSClientConfig == nil { + tlsClientConfig, err := SetupTLSConfig(&tlsConf) + + if err != nil { + return nil, err + } + + transport.TLSClientConfig = tlsClientConfig + } + return client, nil }