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 GitHub
parent 3fd8653b40
commit ad34f42467
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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, ":") {