Skip to content

Commit

Permalink
Increase ACME client HTTP timeout to 90s
Browse files Browse the repository at this point in the history
This is the final part of implementing
#5214

This timeout is shorter than the 2 minute timeout we increased
controllers to - that's because we'd generally expect that controller
sync loops would need to do additional actions before and after making
HTTP requests.

Signed-off-by: Ashley Davis <ashley.davis@jetstack.io>
  • Loading branch information
SgtCoDFish committed Jun 20, 2022
1 parent 03aff7e commit 08379b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/acme/accounts/client.go
Expand Up @@ -32,6 +32,13 @@ import (
"github.com/cert-manager/cert-manager/pkg/metrics"
)

const (
// defaultACMEHTTPTimeout sets the default maximum time that an individual HTTP request can take when doing ACME operations.
// Note that there may be other timeouts - e.g. dial timeouts or TLS handshake timeouts - which will be smaller than this. This
// timeout is the overall timeout for the entire request.
defaultACMEHTTPTimeout = time.Second * 90
)

// NewClientFunc is a function type for building a new ACME client.
type NewClientFunc func(*http.Client, cmacme.ACMEIssuer, *rsa.PrivateKey, string) acmecl.Interface

Expand Down Expand Up @@ -70,6 +77,6 @@ func BuildHTTPClient(metrics *metrics.Metrics, skipTLSVerify bool) *http.Client
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
},
Timeout: time.Second * 30,
Timeout: defaultACMEHTTPTimeout,
})
}

0 comments on commit 08379b2

Please sign in to comment.