mirror of
https://github.com/go-acme/lego.git
synced 2025-07-03 22:20:27 +02:00
Increase HTTP client timeouts (#1336)
This commit is contained in:
@ -64,15 +64,15 @@ type CertificateConfig struct {
|
|||||||
// based on the caCertificatesEnvVar environment variable (see the `initCertPool` function).
|
// based on the caCertificatesEnvVar environment variable (see the `initCertPool` function).
|
||||||
func createDefaultHTTPClient() *http.Client {
|
func createDefaultHTTPClient() *http.Client {
|
||||||
return &http.Client{
|
return &http.Client{
|
||||||
|
Timeout: 2 * time.Minute,
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
Proxy: http.ProxyFromEnvironment,
|
Proxy: http.ProxyFromEnvironment,
|
||||||
DialContext: (&net.Dialer{
|
DialContext: (&net.Dialer{
|
||||||
Timeout: 30 * time.Second,
|
Timeout: 30 * time.Second,
|
||||||
KeepAlive: 30 * time.Second,
|
KeepAlive: 30 * time.Second,
|
||||||
}).DialContext,
|
}).DialContext,
|
||||||
TLSHandshakeTimeout: 15 * time.Second,
|
TLSHandshakeTimeout: 30 * time.Second,
|
||||||
ResponseHeaderTimeout: 15 * time.Second,
|
ResponseHeaderTimeout: 30 * time.Second,
|
||||||
ExpectContinueTimeout: 1 * time.Second,
|
|
||||||
TLSClientConfig: &tls.Config{
|
TLSClientConfig: &tls.Config{
|
||||||
ServerName: os.Getenv(caServerNameEnvVar),
|
ServerName: os.Getenv(caServerNameEnvVar),
|
||||||
RootCAs: initCertPool(),
|
RootCAs: initCertPool(),
|
||||||
|
Reference in New Issue
Block a user