diff --git a/tools/pd-ctl/pdctl/command/global.go b/tools/pd-ctl/pdctl/command/global.go index f012c2999187..8c145895db74 100644 --- a/tools/pd-ctl/pdctl/command/global.go +++ b/tools/pd-ctl/pdctl/command/global.go @@ -26,10 +26,14 @@ import ( "github.com/pingcap/errors" "github.com/spf13/cobra" "github.com/tikv/pd/pkg/apiutil" +<<<<<<< HEAD <<<<<<< HEAD "go.etcd.io/etcd/pkg/transport" ======= >>>>>>> baa5163b (close #4490: add teset) +======= + "go.etcd.io/etcd/pkg/transport" +>>>>>>> 03d80301 (close #4490: add teset) ) var ( @@ -42,6 +46,15 @@ var ( // InitHTTPSClient creates https client with ca file func InitHTTPSClient(caPath, certPath, keyPath string) error { + tlsInfo := transport.TLSInfo{ + CertFile: certPath, + KeyFile: keyPath, + TrustedCAFile: caPath, + } + tlsConfig, err := tlsInfo.ClientConfig() + if err != nil { + return errors.WithStack(err) + } dialClient = &http.Client{ <<<<<<< HEAD @@ -50,7 +63,8 @@ func InitHTTPSClient(caPath, certPath, keyPath string) error { ======= Transport: &apiutil.UserSignatureRoundTripper{ Component: "pdctl", - Proxied: http.DefaultTransport, + Proxied: &http.Transport{ + TLSClientConfig: tlsConfig}, }, >>>>>>> baa5163b (close #4490: add teset) }