Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Renew certificate 3 weeks before expiry
Browse files Browse the repository at this point in the history
This seems to fit letsencrypt better, as it sends out certificate renew reminder emails ~19 days
before expiry
  • Loading branch information
chr4 committed Aug 31, 2016
1 parent fa41202 commit 97f0456
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/acme/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ func runCert(args []string) {
certPath := sameDir(certKeypath, cn+".crt")
certCrt, err := readCrt(certPath)
if err == nil {
// do not re-issue certificate if it's not about to expire in less than one week
// do not re-issue certificate if it's not about to expire in less than three weeks
expiresIn := certCrt.NotAfter.Sub(time.Now())
if expiresIn > 24*7*time.Hour {
errorf("cert is still valid for more than one week, not renewing")
if expiresIn > 24*7*3*time.Hour {
errorf("cert is still valid for more than a three weeks, not renewing")
exit()
}
}
Expand Down

0 comments on commit 97f0456

Please sign in to comment.