forked from TrueCloudLab/certificates
Initialize certNotAfter to avoid a renew when the server starts.
This commit is contained in:
parent
19c4842cdf
commit
7b175004cb
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue