修复客户端CA证书设置不起作用的Bug

This commit is contained in:
刘祥超
2023-02-09 11:31:33 +08:00
parent be29ba72a0
commit ec166af0c3
2 changed files with 14 additions and 0 deletions

View File

@@ -71,6 +71,8 @@ func (this *SSLPolicy) Init() error {
}
// CA certs
this.clientCAPool = x509.NewCertPool()
for _, cert := range this.ClientCACerts {
err := cert.Init()
if err != nil {
@@ -80,6 +82,10 @@ func (this *SSLPolicy) Init() error {
for _, dnsName := range cert.DNSNames {
this.nameMapping[dnsName] = cert.CertObject()
}
for _, caCert := range cert.CACerts() {
this.clientCAPool.AddCert(caCert)
}
}
// min version