diff --git a/acme/dns_challenge_digitalocean.go b/acme/dns_challenge_digitalocean.go index 7d2ee840..176439e6 100644 --- a/acme/dns_challenge_digitalocean.go +++ b/acme/dns_challenge_digitalocean.go @@ -61,8 +61,7 @@ func (d *DNSProviderDigitalOcean) Present(domain, token, keyAuth string) error { req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", d.apiAuthToken)) - var client http.Client - resp, err := client.Do(req) + resp, err := http.DefaultClient.Do(req) if err != nil { return err } @@ -107,8 +106,7 @@ func (d *DNSProviderDigitalOcean) CleanUp(domain, token, keyAuth string) error { req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", d.apiAuthToken)) - var client http.Client - resp, err := client.Do(req) + resp, err := http.DefaultClient.Do(req) if err != nil { return err } diff --git a/acme/http.go b/acme/http.go index 3272840e..4eb8ee18 100644 --- a/acme/http.go +++ b/acme/http.go @@ -32,8 +32,7 @@ func httpHead(url string) (resp *http.Response, err error) { req.Header.Set("User-Agent", userAgent()) - client := http.Client{} - resp, err = client.Do(req) + resp, err = http.DefaultClient.Do(req) if resp.Body != nil { resp.Body.Close() } @@ -50,8 +49,7 @@ func httpPost(url string, bodyType string, body io.Reader) (resp *http.Response, req.Header.Set("Content-Type", bodyType) req.Header.Set("User-Agent", userAgent()) - client := http.Client{} - return client.Do(req) + return http.DefaultClient.Do(req) } // httpGet performs a GET request with a proper User-Agent string. @@ -63,8 +61,7 @@ func httpGet(url string) (resp *http.Response, err error) { } req.Header.Set("User-Agent", userAgent()) - client := http.Client{} - return client.Do(req) + return http.DefaultClient.Do(req) } // getJSON performs an HTTP GET request and parses the response body