fix certs again

This commit is contained in:
crapStone 2024-04-30 23:45:07 +02:00 committed by crapStone
parent 3a1ba2d5ac
commit 558b3f6075

View file

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