From dbefe685912e286fce16bf9dd3773f4037cdcdf1 Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Mon, 20 Aug 2018 17:43:42 +0100 Subject: Small updates - Test against 1.11 rc - Set timeouts on the http client - Use gofmt instead of goimports --- client/client.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'client') diff --git a/client/client.go b/client/client.go index dc4ada1..b84e09a 100644 --- a/client/client.go +++ b/client/client.go @@ -89,10 +89,12 @@ func send(sr *lib.SignRequest, token, ca string, ValidateTLSCertificate bool) (* if err != nil { return nil, errors.Wrap(err, "unable to create sign request") } - transport := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: !ValidateTLSCertificate}, + client := &http.Client{ + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: !ValidateTLSCertificate}, + }, + Timeout: 30 * time.Second, } - client := &http.Client{Transport: transport} u, err := url.Parse(ca) if err != nil { return nil, errors.Wrap(err, "unable to parse CA url") -- cgit v1.2.3