Skip to content

Commit

Permalink
fix: 修复多域名时证书匹配的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
eryajf committed Nov 18, 2024
1 parent b0d7db5 commit c409194
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/export/record_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ func GetCertInfo(record provider.GetRecordCertReq) (certInfo provider.RecordCert

cert := certs[0]
certInfo.SubjectCommonName = cert.Subject.CommonName
if strings.Contains(certInfo.SubjectCommonName, record.DomainName) {
certInfo.IssuerCommonName = cert.Issuer.CommonName
if strings.Contains(certInfo.SubjectCommonName, record.DomainName) || strings.Contains(certInfo.IssuerCommonName, record.DomainName) {
certInfo.CertMatched = true
} else {
certInfo.CertMatched = false
Expand All @@ -104,8 +105,6 @@ func GetCertInfo(record provider.GetRecordCertReq) (certInfo provider.RecordCert
if len(cert.Subject.OrganizationalUnit) > 0 {
certInfo.SubjectOrganizationalUnit = cert.Subject.OrganizationalUnit[0]
}
// 从证书中提取颁发者信息
certInfo.IssuerCommonName = cert.Issuer.CommonName
if len(cert.Issuer.Organization) > 0 {
certInfo.IssuerOrganization = cert.Issuer.Organization[0]
}
Expand Down

0 comments on commit c409194

Please sign in to comment.