Only generate certificates after CertificateRequired

This commit is contained in:
adnano 2020-09-27 23:58:45 -04:00
parent ae4b458964
commit 5d099a4fe1
2 changed files with 18 additions and 7 deletions

View File

@ -6,6 +6,7 @@ import (
"crypto/x509" "crypto/x509"
"errors" "errors"
"io/ioutil" "io/ioutil"
"log"
"net" "net"
"net/url" "net/url"
"strconv" "strconv"
@ -188,7 +189,7 @@ type Client struct {
CertificateStore CertificateStore CertificateStore CertificateStore
// GetCertificate, if not nil, will be called to determine which certificate // GetCertificate, if not nil, will be called to determine which certificate
// (if any) should be used for a request. // to use when the server responds with CertificateRequired.
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 // TrustCertificate, if not nil, will be called to determine whether the