mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-22 18:37:15 +00:00
Check if the server actually configured with a certificate
This commit is contained in:
committed by
Urvashi Reddy
parent
012910f76f
commit
7c27cd08ad
@@ -65,6 +65,9 @@ func createTestServer(
|
||||
}
|
||||
|
||||
// calculate the leaf certificate's fingerprint
|
||||
if len(server.TLS.Certificates) < 1 || len(server.TLS.Certificates[0].Certificate) < 1 {
|
||||
t.Fatal("Expected server.TLS.Certificates not to be empty")
|
||||
}
|
||||
x509LeafCert := server.TLS.Certificates[0].Certificate[0]
|
||||
tpBytes := sha1.Sum(x509LeafCert)
|
||||
tpString := fmt.Sprintf("%x", tpBytes)
|
||||
|
Reference in New Issue
Block a user