fix: use http.DefaultTransport in S3 client

Unfortunately one of the changes we merged in broken the support for
http.ProxyFromEnvironment https://pkg.go.dev/net/http#ProxyFromEnvironment

This commit attempts to fix that by cloning the http.DefaultTransport
and updating it accordingly.

Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
Milos Gajdos 2023-12-15 09:34:06 +00:00
parent b8fb08e0a1
commit 8fa7a81cb2
No known key found for this signature in database

View file

@ -560,9 +560,8 @@ func New(ctx context.Context, params DriverParameters) (*Driver, error) {
} }
if params.SkipVerify { if params.SkipVerify {
httpTransport := &http.Transport{ httpTransport := http.DefaultTransport.(*http.Transport).Clone()
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, httpTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
}
awsConfig.WithHTTPClient(&http.Client{ awsConfig.WithHTTPClient(&http.Client{
Transport: httpTransport, Transport: httpTransport,
}) })