Changes tlsConfig init for proxy connections (#1121)

https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1116
This commit is contained in:
Nikolay 2021-03-09 19:51:00 +03:00 committed by Aliaksandr Valialkin
parent 0554430d7e
commit 1310f84122
2 changed files with 2 additions and 2 deletions

View file

@ -57,7 +57,7 @@ func newClient(sw *ScrapeWork) *client {
requestURI := string(u.RequestURI())
isTLS := string(u.Scheme()) == "https"
var tlsCfg *tls.Config
if isTLS {
if sw.AuthConfig != nil {
tlsCfg = sw.AuthConfig.NewTLSConfig()
}
if !strings.Contains(host, ":") {

View file

@ -66,7 +66,7 @@ func NewClient(apiServer string, ac *promauth.Config, proxyURL proxy.URL) (*Clie
hostPort := string(u.Host())
isTLS := string(u.Scheme()) == "https"
if isTLS && ac != nil {
if ac != nil {
tlsCfg = ac.NewTLSConfig()
}
if !strings.Contains(hostPort, ":") {