diff options
| author | adnano <[email protected]> | 2020-09-27 17:39:44 -0400 |
|---|---|---|
| committer | adnano <[email protected]> | 2020-09-27 17:39:44 -0400 |
| commit | b46a05e5ffd47bc9dc3de3aad6f55d4b6ea35dd9 (patch) | |
| tree | b0287d3ecc58536c1205e04802d229cb78c46675 /client.go | |
| parent | Fix README.md (diff) | |
| download | go-gemini-b46a05e5ffd47bc9dc3de3aad6f55d4b6ea35dd9.tar.xz go-gemini-b46a05e5ffd47bc9dc3de3aad6f55d4b6ea35dd9.zip | |
Add client authorization example
Diffstat (limited to 'client.go')
| -rw-r--r-- | client.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -32,7 +32,8 @@ type Request struct { Host string // Certificate specifies the TLS certificate to use for the request. - Certificate tls.Certificate + // This field is ignored by the server. + Certificate *tls.Certificate // RemoteAddr allows servers and other software to record the network // address that sent the request. @@ -194,14 +195,13 @@ func (c *Client) Send(req *Request) (*Response, error) { config := &tls.Config{ InsecureSkipVerify: true, MinVersion: tls.VersionTLS12, - Certificates: []tls.Certificate{req.Certificate}, GetClientCertificate: func(info *tls.CertificateRequestInfo) (*tls.Certificate, error) { if c.GetCertificate != nil { if cert := c.GetCertificate(req, c.CertificateStore); cert != nil { return cert, nil } } - return &req.Certificate, nil + return req.Certificate, nil }, VerifyPeerCertificate: func(rawCerts [][]byte, _ [][]*x509.Certificate) error { // Parse the certificate |