aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'server.go')
-rw-r--r--server.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/server.go b/server.go
index 0590bb9..449f88d 100644
--- a/server.go
+++ b/server.go
@@ -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 {