fix certs again

This commit is contained in:
crapStone 2024-04-30 23:45:07 +02:00 committed by crapStone
parent 3a1ba2d5ac
commit 558b3f6075
1 changed files with 4 additions and 4 deletions

View File

@ -192,13 +192,13 @@ func (c *AcmeClient) retrieveCertFromDB(sni, mainDomainSuffix string, useDnsProv
if err != nil {
return nil, err
}
tlsCertificate.Leaf, err = leaf(&tlsCertificate)
if err != nil {
return nil, err
}
// TODO: document & put into own function
if !strings.EqualFold(sni, mainDomainSuffix) {
tlsCertificate.Leaf, err = leaf(&tlsCertificate)
if err != nil {
return nil, err
}
// renew certificates 7 days before they expire
if tlsCertificate.Leaf.NotAfter.Before(time.Now().Add(7 * 24 * time.Hour)) {