From 8fa7a81cb26469b3f33344c1e47efcae37df4a11 Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Fri, 15 Dec 2023 09:34:06 +0000 Subject: [PATCH] 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 --- registry/storage/driver/s3-aws/s3.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/registry/storage/driver/s3-aws/s3.go b/registry/storage/driver/s3-aws/s3.go index 7dde1f720..2d51ddf7f 100644 --- a/registry/storage/driver/s3-aws/s3.go +++ b/registry/storage/driver/s3-aws/s3.go @@ -560,9 +560,8 @@ func New(ctx context.Context, params DriverParameters) (*Driver, error) { } if params.SkipVerify { - httpTransport := &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, - } + httpTransport := http.DefaultTransport.(*http.Transport).Clone() + httpTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true} awsConfig.WithHTTPClient(&http.Client{ Transport: httpTransport, })