Increase HTTP client timeouts (#1336)

This commit is contained in:
Albert Peschar 2021-02-28 12:59:51 +00:00 committed by GitHub
parent 8b8be6f21e
commit 72c7034298
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,15 +64,15 @@ type CertificateConfig struct {
// based on the caCertificatesEnvVar environment variable (see the `initCertPool` function).
func createDefaultHTTPClient() *http.Client {
return &http.Client{
Timeout: 2 * time.Minute,
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).DialContext,
TLSHandshakeTimeout: 15 * time.Second,
ResponseHeaderTimeout: 15 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
TLSHandshakeTimeout: 30 * time.Second,
ResponseHeaderTimeout: 30 * time.Second,
TLSClientConfig: &tls.Config{
ServerName: os.Getenv(caServerNameEnvVar),
RootCAs: initCertPool(),