Set proxy for all connections, fixes #4326 (#4579)

Signed-off-by: Christian Koeberl <christian.koeberl@gmail.com>
pull/4207/head^2
Christian Köberl 7 years ago committed by Sebastien Plisson
parent abdd0f2f60
commit 297d942a64

@ -83,6 +83,7 @@ func NewHTTPGetter(URL, CertFile, KeyFile, CAFile string) (*HttpGetter, error) {
var client HttpGetter
tr := &http.Transport{
DisableCompression: true,
Proxy: http.ProxyFromEnvironment,
}
if (CertFile != "" && KeyFile != "") || CAFile != "" {
tlsConf, err := tlsutil.NewTLSConfig(URL, CertFile, KeyFile, CAFile)
@ -90,7 +91,6 @@ func NewHTTPGetter(URL, CertFile, KeyFile, CAFile string) (*HttpGetter, error) {
return &client, fmt.Errorf("can't create TLS config: %s", err.Error())
}
tr.TLSClientConfig = tlsConf
tr.Proxy = http.ProxyFromEnvironment
}
client.client = &http.Client{Transport: tr}
return &client, nil

Loading…
Cancel
Save