diff options
| author | Adnan Maolood <[email protected]> | 2021-03-20 12:54:39 -0400 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-03-20 12:54:41 -0400 |
| commit | fffe86680e2ed18b31113975f0a84142c3f4000f (patch) | |
| tree | 7e4e81c183e18f0f4200a044a83533f43079cdc8 | |
| parent | client: Close connection on error (diff) | |
| download | go-gemini-fffe86680e2ed18b31113975f0a84142c3f4000f.tar.xz go-gemini-fffe86680e2ed18b31113975f0a84142c3f4000f.zip | |
client: Only get cert if TrustCertificate is set
| -rw-r--r-- | client.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -177,9 +177,9 @@ func (c *Client) dialContext(ctx context.Context, network, addr string) (net.Con } func (c *Client) verifyConnection(cs tls.ConnectionState, hostname string) error { - cert := cs.PeerCertificates[0] // See if the client trusts the certificate if c.TrustCertificate != nil { + cert := cs.PeerCertificates[0] return c.TrustCertificate(hostname, cert) } return nil |