Removed hardcoded paths and fixed typo

This commit is contained in:
Daniel Del Rio Figueira 2024-12-02 09:26:25 +01:00
parent d5e2df49db
commit 72cfd79b77
No known key found for this signature in database
GPG key ID: 16C55CB50D1B770D

View file

@ -17,12 +17,12 @@ func GetClientCertificate() (tls.Certificate, error) {
return tls.Certificate{}, nil return tls.Certificate{}, nil
} }
if certExists && !keyExists { if certExists && !keyExists {
return tls.Certificate{}, fmt.Errorf("Client TLS private key is empty, but client TLS cert was sent.") return tls.Certificate{}, fmt.Errorf("Client TLS private key is empty, but client TLS cert was set.")
} }
if !certExists && keyExists { if !certExists && keyExists {
return tls.Certificate{}, fmt.Errorf("Client TLS cert is empty, but client TLS private key was sent.") return tls.Certificate{}, fmt.Errorf("Client TLS cert is empty, but client TLS private key was set.")
} }
return tls.LoadX509KeyPair("client.cert", "client-key.pem") return tls.LoadX509KeyPair(cert, key)
} }
func GetHttpClient() (*http.Client, error) { func GetHttpClient() (*http.Client, error) {