Skip to content

Commit 2481ec7

Browse files
committed
BUG/MINOR: Avoid formatting issue when a certificate has no CommonName
1 parent 5979b87 commit 2481ec7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

storage/cert-info.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ func (ci *certsInfo) parseCertificate(der []byte) error {
8181
ci.Issuers[crt.Issuer.CommonName] = struct{}{}
8282

8383
if !crt.IsCA {
84-
ci.DNS[crt.Subject.CommonName] = struct{}{}
84+
if crt.Subject.CommonName != "" {
85+
ci.DNS[crt.Subject.CommonName] = struct{}{}
86+
}
8587
// Alternate Subject Names
8688
for _, name := range crt.DNSNames {
8789
ci.DNS[name] = struct{}{}

0 commit comments

Comments
 (0)