From dd588bbb87101c3f5190e2cbe20cffa4e381d797 Mon Sep 17 00:00:00 2001 From: Cabinfever_B Date: Thu, 23 Dec 2021 03:29:05 +0800 Subject: [PATCH] close #4490: add teset Signed-off-by: Cabinfever_B --- tools/pd-ctl/pdctl/command/global.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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) }