Skip to content

Commit

Permalink
Merge pull request #8223 from heyitsanthony/ip-san-exit
Browse files Browse the repository at this point in the history
transport: accept connection if matched IP SAN but no DNS match
  • Loading branch information
Anthony Romano authored Jul 7, 2017
2 parents e6f4563 + ab95eb0 commit 67fa8b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/transport/listener_tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ func checkCertSAN(ctx context.Context, cert *x509.Certificate, remoteAddr string
return herr
}
if len(cert.IPAddresses) > 0 {
if cerr := cert.VerifyHostname(h); cerr != nil && len(cert.DNSNames) == 0 {
cerr := cert.VerifyHostname(h)
if cerr == nil {
return nil
}
if len(cert.DNSNames) == 0 {
return cerr
}
}
Expand Down

0 comments on commit 67fa8b8

Please sign in to comment.