From 4dae8a3cccb3a42d3a8423dfd5e84a329ecc2309 Mon Sep 17 00:00:00 2001 From: ShuNing Date: Tue, 21 Apr 2020 17:12:27 +0800 Subject: [PATCH] api: fix the certificate problem in API client (#2363) Signed-off-by: nolouch --- server/api/util.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/server/api/util.go b/server/api/util.go index 5c5fd6df8b2..37583669bed 100644 --- a/server/api/util.go +++ b/server/api/util.go @@ -20,17 +20,14 @@ import ( "net/http" "net/url" + "github.com/pingcap/pd/v4/server/cluster" "github.com/pkg/errors" ) -// dialClient used to dial http request. -var dialClient = &http.Client{ - Transport: &http.Transport{ - DisableKeepAlives: true, - }, -} - var ( + + // dialClient used to dial http request. + dialClient = cluster.DialClient errNoImplement = errors.New("no implement") errOptionNotExist = func(name string) error { return errors.Errorf("the option %s does not exist", name) } )