From f422c9eadea2bce40b57947e463357b8f03011d1 Mon Sep 17 00:00:00 2001 From: Ross Kirkpatrick Date: Fri, 24 Jun 2022 18:07:07 -0400 Subject: [PATCH] read proxy config from env vars for csi-proxy download --- pkg/csiproxy/csi.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/csiproxy/csi.go b/pkg/csiproxy/csi.go index a18c111d..26319467 100644 --- a/pkg/csiproxy/csi.go +++ b/pkg/csiproxy/csi.go @@ -134,7 +134,9 @@ func (p *Proxy) download() error { } // default to insecure which matches system-agent functionality - transport := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}} + // if a proxy is set with the proper envvars, we will use it + // as long as the req does not match an entry in no_proxy env var + transport := &http.Transport{TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, Proxy: http.ProxyFromEnvironment} if p.tlsCfg != nil && !*p.tlsCfg.Insecure && p.tlsCfg.CertFilePath != "" { transport.TLSClientConfig.InsecureSkipVerify = false