diff --git a/caddytls/client.go b/caddytls/client.go index c754ab1c..a051880f 100644 --- a/caddytls/client.go +++ b/caddytls/client.go @@ -236,9 +236,11 @@ func (c *ACMEClient) Renew(name string) error { var newCertMeta acme.CertificateResource var success bool for attempts := 0; attempts < 2; attempts++ { + namesObtaining.Add([]string{name}) acmeMu.Lock() newCertMeta, err = c.RenewCertificate(certMeta, true) acmeMu.Unlock() + namesObtaining.Remove([]string{name}) if err == nil { success = true break diff --git a/caddytls/config.go b/caddytls/config.go index 89ccafd7..f1dcff84 100644 --- a/caddytls/config.go +++ b/caddytls/config.go @@ -214,9 +214,11 @@ func (c *Config) renewCertName(name string, allowPrompts bool) error { var newCertMeta acme.CertificateResource var success bool for attempts := 0; attempts < 2; attempts++ { + namesObtaining.Add([]string{name}) acmeMu.Lock() newCertMeta, err = client.RenewCertificate(certMeta, true) acmeMu.Unlock() + namesObtaining.Remove([]string{name}) if err == nil { success = true break