mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 07:19:17 +01:00
Changes tlsConfig init for proxy connections (#1121)
https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1116
This commit is contained in:
parent
0554430d7e
commit
1310f84122
@ -57,7 +57,7 @@ func newClient(sw *ScrapeWork) *client {
|
|||||||
requestURI := string(u.RequestURI())
|
requestURI := string(u.RequestURI())
|
||||||
isTLS := string(u.Scheme()) == "https"
|
isTLS := string(u.Scheme()) == "https"
|
||||||
var tlsCfg *tls.Config
|
var tlsCfg *tls.Config
|
||||||
if isTLS {
|
if sw.AuthConfig != nil {
|
||||||
tlsCfg = sw.AuthConfig.NewTLSConfig()
|
tlsCfg = sw.AuthConfig.NewTLSConfig()
|
||||||
}
|
}
|
||||||
if !strings.Contains(host, ":") {
|
if !strings.Contains(host, ":") {
|
||||||
|
@ -66,7 +66,7 @@ func NewClient(apiServer string, ac *promauth.Config, proxyURL proxy.URL) (*Clie
|
|||||||
|
|
||||||
hostPort := string(u.Host())
|
hostPort := string(u.Host())
|
||||||
isTLS := string(u.Scheme()) == "https"
|
isTLS := string(u.Scheme()) == "https"
|
||||||
if isTLS && ac != nil {
|
if ac != nil {
|
||||||
tlsCfg = ac.NewTLSConfig()
|
tlsCfg = ac.NewTLSConfig()
|
||||||
}
|
}
|
||||||
if !strings.Contains(hostPort, ":") {
|
if !strings.Contains(hostPort, ":") {
|
||||||
|
Loading…
Reference in New Issue
Block a user