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