diff --git a/pkg/acme/acme.go b/pkg/acme/acme.go index 273c6f866..154a90b67 100644 --- a/pkg/acme/acme.go +++ b/pkg/acme/acme.go @@ -193,6 +193,12 @@ func lookupClient(spec *cmapi.ACMEIssuer, status *cmapi.ACMEIssuerStatus, pk *rs return acmeCl } +func ClearClientCache() { + clientRepoMu.Lock() + defer clientRepoMu.Unlock() + clientRepo = nil +} + // buildHTTPClient returns an HTTP client to be used by the ACME client. // For the time being, we construct a new HTTP client on each invocation. // This is because we need to set the 'skipTLSVerify' flag on the HTTP client diff --git a/pkg/issuer/acme/setup.go b/pkg/issuer/acme/setup.go index 734a6d042..c6960d4d9 100644 --- a/pkg/issuer/acme/setup.go +++ b/pkg/issuer/acme/setup.go @@ -96,6 +96,8 @@ func (a *Acme) Setup(ctx context.Context) error { } + acme.ClearClientCache() + cl, err := acme.ClientWithKey(a.issuer, pk) if err != nil { s := messageAccountVerificationFailed + err.Error()