File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,9 +99,17 @@ func buildTransport(opts ClientOpts, flags *Flags) *http.Transport {
9999 }
100100
101101 if opts .ProxyURL != nil || opts .ProxyPath != "" {
102+ // Explicit SRC_PROXY configuration takes precedence.
102103 transport = withProxyTransport (transport , opts .ProxyURL , opts .ProxyPath )
104+ } else if proxyURL := envProxyURL (opts .Endpoint ); proxyURL != nil && proxyURL .Scheme == "https" {
105+ // For HTTPS proxies discovered via standard env vars, use our custom
106+ // dialer to force HTTP/1.1 for the CONNECT tunnel. Many proxy servers
107+ // don't support HTTP/2 CONNECT, which Go may negotiate via ALPN when
108+ // TLS-connecting to an https:// proxy.
109+ transport = withProxyTransport (transport , proxyURL , "" )
103110 }
104-
111+ // For http:// and socks5:// proxies from standard env vars, the cloned
112+ // transport's default Proxy handles them correctly without intervention.
105113 return transport
106114}
107115
You can’t perform that action at this time.
0 commit comments