From e345cd12f96b3985257652b606c8463a5772944b Mon Sep 17 00:00:00 2001 From: mrfly Date: Thu, 3 Aug 2017 17:04:26 +0800 Subject: [PATCH] fix client.Transport `client.Transport` is `http.Client.Transport` just has `RoundTripper()`. Not `http.Transport`. So we cannot convert it here. For a mock test, I can play with this https://play.golang.org/p/gs7_QrL9-Y Signed-off-by: wrfly --- client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index 7e14531723..c4e3914b1e 100644 --- a/client/client.go +++ b/client/client.go @@ -165,7 +165,7 @@ func NewClient(host string, version string, client *http.Client, httpHeaders map } if client != nil { - if _, ok := client.Transport.(*http.Transport); !ok { + if _, ok := client.Transport.(http.RoundTripper); !ok { return nil, fmt.Errorf("unable to verify TLS configuration, invalid transport %v", client.Transport) } } else {