Skip to content

Commit d1f0d16

Browse files
committed
Fix SANs length check in expiration validation
Replace unintentional check of the first SANs entry's length with the intended length check of the collection itself. refs GH-1235
1 parent c459911 commit d1f0d16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/certs/validation-expiration.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ func (evr ExpirationValidationResult) Status() string {
706706

707707
// but if it is, use the first SubjectAlternateName field in its place
708708
if nextCertToExpire.Subject.CommonName == "" {
709-
if len(nextCertToExpire.DNSNames[0]) > 0 {
709+
if len(nextCertToExpire.DNSNames) > 0 {
710710
nextCertToExpireServerName = nextCertToExpire.DNSNames[0]
711711
}
712712
}

0 commit comments

Comments
 (0)