Skip to content

Commit

Permalink
Merge pull request #26 from opsre/fix_san
Browse files Browse the repository at this point in the history
  • Loading branch information
eryajf authored Nov 18, 2024
2 parents b0d7db5 + c409194 commit 7d93a36
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 7d93a36

Please sign in to comment.