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

Signed-off-by: Christian Koeberl <christian.koeberl@gmail.com>
pull/4229/merge
Christian Köberl 6 years ago committed by Matthew Fisher
parent 7da7047cee
commit 2e9855b98b

@ -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