This commit is contained in:
Adnan Maolood
2020-11-05 22:30:13 -05:00
parent a5712c7705
commit ff6c95930b
3 changed files with 29 additions and 20 deletions

View File

@@ -156,7 +156,7 @@ func (s *Server) getCertificateFor(hostname string) (*tls.Certificate, error) {
// Generate a new certificate if it is missing or expired
cert, ok := s.Certificates.Lookup(hostname)
if !ok || cert.Leaf != nil && !time.Now().After(cert.Leaf.NotAfter) {
if !ok || cert.Leaf != nil && cert.Leaf.NotAfter.Before(time.Now()) {
if s.CreateCertificate != nil {
cert, err := s.CreateCertificate(hostname)
if err == nil {