diff options
| -rw-r--r-- | client.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -5,6 +5,7 @@ import ( "context" "crypto/tls" "crypto/x509" + "errors" "net" "strings" "time" @@ -106,6 +107,10 @@ func (c *Client) verifyConnection(req *Request, cs tls.ConnectionState) error { if err := verifyHostname(cert, hostname); err != nil { return err } + // Check expiration date + if !time.Now().Before(cert.NotAfter) { + return errors.New("gemini: certificate expired") + } // See if the client trusts the certificate if c.TrustCertificate != nil { |