Initialize certNotAfter to avoid a renew when the server starts.

This commit is contained in:
Mariano Cano 2019-02-11 18:55:32 -08:00
parent 19c4842cdf
commit 7b175004cb

View file

@ -72,6 +72,8 @@ func NewTLSRenewer(cert *tls.Certificate, fn RenewFunc, opts ...tlsRenewerOption
if r.renewJitter == 0 { if r.renewJitter == 0 {
r.renewJitter = period / 20 r.renewJitter = period / 20
} }
// Initialize certNotAfter
r.certNotAfter = cert.Leaf.NotAfter.Add(-1 * time.Minute)
return r, nil return r, nil
} }