client: Ignore certificate expiration time
This commit is contained in:
parent
d8fb072826
commit
9f3564936e
@ -6,7 +6,6 @@ import (
|
|||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
"net"
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"golang.org/x/net/idna"
|
"golang.org/x/net/idna"
|
||||||
@ -180,10 +179,6 @@ func (c *Client) verifyConnection(cs tls.ConnectionState, hostname string) error
|
|||||||
if err := verifyHostname(cert, hostname); err != nil {
|
if err := verifyHostname(cert, hostname); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Check expiration date
|
|
||||||
if !time.Now().Before(cert.NotAfter) {
|
|
||||||
return ErrCertificateExpired
|
|
||||||
}
|
|
||||||
// See if the client trusts the certificate
|
// See if the client trusts the certificate
|
||||||
if c.TrustCertificate != nil {
|
if c.TrustCertificate != nil {
|
||||||
return c.TrustCertificate(hostname, cert)
|
return c.TrustCertificate(hostname, cert)
|
||||||
|
@ -18,8 +18,6 @@ var (
|
|||||||
ErrInvalidRequest = errors.New("gemini: invalid request")
|
ErrInvalidRequest = errors.New("gemini: invalid request")
|
||||||
ErrInvalidResponse = errors.New("gemini: invalid response")
|
ErrInvalidResponse = errors.New("gemini: invalid response")
|
||||||
|
|
||||||
ErrCertificateExpired = errors.New("gemini: certificate expired")
|
|
||||||
|
|
||||||
// ErrBodyNotAllowed is returned by ResponseWriter.Write calls
|
// ErrBodyNotAllowed is returned by ResponseWriter.Write calls
|
||||||
// when the response status code does not permit a body.
|
// when the response status code does not permit a body.
|
||||||
ErrBodyNotAllowed = errors.New("gemini: response status code does not allow body")
|
ErrBodyNotAllowed = errors.New("gemini: response status code does not allow body")
|
||||||
|
Loading…
Reference in New Issue
Block a user