diff --git a/server/certificates/certificates.go b/server/certificates/certificates.go index 4acde2e..12e2e13 100644 --- a/server/certificates/certificates.go +++ b/server/certificates/certificates.go @@ -112,19 +112,10 @@ func TLSConfig(mainDomainSuffix string, } if tlsCertificate, ok := keyCache.Get(domain); ok { - if tlsCertificate.Leaf == nil { - log.Error().Msg("Leaf is nil") - tlsCertificate.Leaf, err = x509.ParseCertificate(tlsCertificate.Certificate[0]) - if err != nil { - return nil, fmt.Errorf("error parsing leaf tlsCert: %w", err) - } - } - // if Leaf == nil the certificate can't be in the cache for a long time so we just ignore it - if tlsCertificate.Leaf != nil && tlsCertificate.Leaf.NotAfter.Before(time.Now().Add(7*24*time.Hour)) { + if tlsCertificate.Leaf.NotAfter.Before(time.Now().Add(7 * 24 * time.Hour)) { // if cert is up for renewal remove it from the cache keyCache.Remove(domain) } else { - log.Error().Msg("Cert is not expired") // we can use an existing certificate object return tlsCertificate, nil }