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

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

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

Loading…
Cancel
Save