app/vmagent: properly set client-side TLS certificates for -remoteWrite.url. Previously they were mistakenly set as server-side

This commit is contained in:
Aliaksandr Valialkin 2020-05-06 16:50:22 +03:00
parent 9f39e618ed
commit 12dbb9e22c

View file

@ -169,7 +169,9 @@ func getTLSConfig() (*tls.Config, error) {
ClientSessionCache: tls.NewLRUClientSessionCache(0),
}
if tlsCertificate != nil {
tlsCfg.Certificates = []tls.Certificate{*tlsCertificate}
tlsCfg.GetClientCertificate = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) {
return tlsCertificate, nil
}
}
tlsCfg.InsecureSkipVerify = *tlsInsecureSkipVerify
return tlsCfg, nil