Check if the server actually configured with a certificate

This commit is contained in:
Hannes Hörl 2018-06-18 13:49:05 +01:00 committed by Urvashi Reddy
parent 012910f76f
commit 7c27cd08ad

View File

@ -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)