aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authoradnano <[email protected]>2020-09-27 17:39:44 -0400
committeradnano <[email protected]>2020-09-27 17:39:44 -0400
commitb46a05e5ffd47bc9dc3de3aad6f55d4b6ea35dd9 (patch)
treeb0287d3ecc58536c1205e04802d229cb78c46675 /client.go
parentFix README.md (diff)
downloadgo-gemini-b46a05e5ffd47bc9dc3de3aad6f55d4b6ea35dd9.tar.xz
go-gemini-b46a05e5ffd47bc9dc3de3aad6f55d4b6ea35dd9.zip
Add client authorization example
Diffstat (limited to 'client.go')
-rw-r--r--client.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/client.go b/client.go
index be6d81d..de625d7 100644
--- a/client.go
+++ b/client.go
@@ -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