fix: 证书校验规则修改 (#788)

pull/791/head^2
ssongliu 2023-04-26 08:04:10 +08:00 committed by GitHub
parent 2d31c5b005
commit 14cc97eb44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -326,7 +326,11 @@ func checkCertValid(domain string) error {
if _, err = tls.X509KeyPair(certificate, key); err != nil {
return err
}
certObj, err := x509.ParseCertificate(certificate)
certBlock, _ := pem.Decode(certificate)
if certBlock == nil {
return err
}
certObj, err := x509.ParseCertificate(certBlock.Bytes)
if err != nil {
return err
}