兼容不支持SNI的情况

This commit is contained in:
bjdgyc 2023-04-21 14:44:53 +08:00
parent 6ee80d32ea
commit c05ec9ab36
1 changed files with 2 additions and 2 deletions

View File

@ -355,7 +355,7 @@ func GetCertificateBySNI(commonName string) (*tls.Certificate, error) {
return cert, nil
}
}
// 默认证书 兼容不支持 SNI 的客户端
// TODO 默认证书 兼容不支持 SNI 的客户端
if cert, ok := nameToCertificate["default"]; ok {
return cert, nil
}
@ -369,7 +369,7 @@ func LoadCertificate(cert *tls.Certificate) {
// Copy from tls.Config BuildNameToCertificate()
func buildNameToCertificate(cert *tls.Certificate) {
// 设置默认证书
// TODO 设置默认证书
nameToCertificate["default"] = cert
x509Cert, err := x509.ParseCertificate(cert.Certificate[0])