Update documentation

This commit is contained in:
adnano
2020-10-12 16:34:52 -04:00
parent 2370c42d8d
commit a33a5be063
9 changed files with 101 additions and 119 deletions

View File

@@ -198,7 +198,7 @@ type Client struct {
// The returned certificate will be used when sending the request again.
// If the certificate is nil, the request will not be sent again and
// the response will be returned.
GetCertificate func(hostname string, store CertificateStore) *tls.Certificate
GetCertificate func(hostname string, store *CertificateStore) *tls.Certificate
// TrustCertificate, if not nil, will be called to determine whether the
// client should trust the given certificate.
@@ -279,7 +279,7 @@ func (c *Client) Send(req *Request) (*Response, error) {
return resp, nil
}
if c.GetCertificate != nil {
if cert := c.GetCertificate(req.Hostname(), c.CertificateStore); cert != nil {
if cert := c.GetCertificate(req.Hostname(), &c.CertificateStore); cert != nil {
req.Certificate = cert
return c.Send(req)
}