mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/promauth: properly set up client certificate in tls.Config
Previously the client certificate has been mistakenly set up as a server certificate
This commit is contained in:
parent
ed91fe1d9b
commit
28e0e8fd88
1 changed files with 3 additions and 1 deletions
|
@ -69,7 +69,9 @@ func (ac *Config) NewTLSConfig() *tls.Config {
|
||||||
ClientSessionCache: tls.NewLRUClientSessionCache(0),
|
ClientSessionCache: tls.NewLRUClientSessionCache(0),
|
||||||
}
|
}
|
||||||
if ac.TLSCertificate != nil {
|
if ac.TLSCertificate != nil {
|
||||||
tlsCfg.Certificates = []tls.Certificate{*ac.TLSCertificate}
|
tlsCfg.GetClientCertificate = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) {
|
||||||
|
return ac.TLSCertificate, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tlsCfg.ServerName = ac.TLSServerName
|
tlsCfg.ServerName = ac.TLSServerName
|
||||||
tlsCfg.InsecureSkipVerify = ac.TLSInsecureSkipVerify
|
tlsCfg.InsecureSkipVerify = ac.TLSInsecureSkipVerify
|
||||||
|
|
Loading…
Reference in a new issue