1
0
mirror of https://github.com/ribbybibby/ssl_exporter.git synced 2025-06-30 23:23:47 +02:00

Fix private key decryption in tests

This commit is contained in:
Rob Best
2019-03-24 20:43:14 +00:00
parent 4c3308f819
commit 30c8ffb7c3

View File

@ -31,9 +31,11 @@ func TestProbeHandler(t *testing.T) {
t.Fatalf("Issue decrypting test client key") t.Fatalf("Issue decrypting test client key")
} }
keyContent = pem.EncodeToMemory(&pem.Block{Type: keyBlock.Type, Bytes: keyBlockDecrypted})
emptyRootCAs := x509.NewCertPool() emptyRootCAs := x509.NewCertPool()
certificate, _ := tls.X509KeyPair(certContent, keyBlockDecrypted) certificate, err := tls.X509KeyPair(certContent, keyContent)
if err != nil { if err != nil {
t.Fatalf(err.Error()) t.Fatalf(err.Error())
} }