aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authoradnano <[email protected]>2020-09-27 13:50:48 -0400
committeradnano <[email protected]>2020-09-27 13:50:48 -0400
commit2eb7fb9ba48751cb26efd6324285be3f1f4a98da (patch)
treedbaceef3ff42918971042ba86b4160cf4387ec64 /client.go
parentAdjust user prompt in client example (diff)
downloadgo-gemini-2eb7fb9ba48751cb26efd6324285be3f1f4a98da.tar.xz
go-gemini-2eb7fb9ba48751cb26efd6324285be3f1f4a98da.zip
Implement certificate creation
Diffstat (limited to 'client.go')
-rw-r--r--client.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/client.go b/client.go
index 7af5792..57c144a 100644
--- a/client.go
+++ b/client.go
@@ -205,8 +205,8 @@ func (c *Client) Send(req *Request) (*Response, error) {
return err
}
// Check that the certificate is valid for the hostname
- if cert.Subject.CommonName != hostname(req.Host) {
- return ErrCertificateNotValid
+ if err := cert.VerifyHostname(req.Host); err != nil {
+ return err
}
// Check that the client trusts the certificate
if c.TrustCertificate == nil {