-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
diff --git a/cert/verification.go b/cert/verification.go | ||
index 4af0d77..ac74493 100644 | ||
index 39f255c..b80a643 100644 | ||
--- a/cert/verification.go | ||
+++ b/cert/verification.go | ||
@@ -10,6 +10,10 @@ import ( | ||
@@ -10,6 +10,11 @@ import ( | ||
|
||
// CertificateMatchesHostname checks if the Certificates hosts are the same as the given hosts | ||
func CertificateMatchesHostname(hosts []string, cert *x509.Certificate) bool { | ||
+ // skip checks for kubernetes system certs with invalid DNS names (i.e. CN=system:kube-proxy) | ||
+ if len(hosts) == 1 && len(cert.DNSNames)+len(cert.IPAddresses) == 0 { | ||
+ return true | ||
+ if len(hosts) == 1 && len(cert.DNSNames) + len(cert.IPAddresses) == 0 { | ||
+ return true | ||
+ } | ||
a := make([]string, len(hosts)) | ||
for idx := range hosts { | ||
// normalize the IPs. | ||
+ | ||
a := make([]string, len(hosts)) | ||
for idx := range hosts { | ||
// normalize the IPs. |