Added flags for passing client cert and client private key as file contents instead of paths

This commit is contained in:
Daniel Del Rio Figueira 2024-12-04 00:39:11 +01:00
parent 0273cee2ba
commit 78ed21f62b
No known key found for this signature in database
GPG key ID: 16C55CB50D1B770D
2 changed files with 34 additions and 13 deletions

View file

@ -22,7 +22,7 @@ func GetClientCertificate() (tls.Certificate, error) {
if !certExists && keyExists {
return tls.Certificate{}, fmt.Errorf("Client TLS cert is empty, but client TLS private key was set.")
}
return tls.LoadX509KeyPair(cert, key)
return tls.X509KeyPair([]byte(cert), []byte(key))
}
func GetHttpClient() (*http.Client, error) {