@@ -30,6 +30,7 @@ import (
3030 api "kmodules.xyz/objectstore-api/api/v1"
3131
3232 aws2 "github.com/aws/aws-sdk-go-v2/aws"
33+ awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
3334 "github.com/aws/aws-sdk-go-v2/config"
3435 "github.com/aws/aws-sdk-go-v2/credentials"
3536 "github.com/aws/aws-sdk-go-v2/service/s3"
@@ -503,7 +504,7 @@ func (b *Blob) getS3Config(ctx context.Context, debug bool) (aws2.Config, error)
503504 return config .LoadDefaultConfig (ctx , loadOptions ... )
504505}
505506
506- func configureTLS (caCert []byte , insecureTLS bool ) (* http. Client , error ) {
507+ func configureTLS (caCert []byte , insecureTLS bool ) (* awshttp. BuildableClient , error ) {
507508 tlsConfig := & tls.Config {
508509 InsecureSkipVerify : insecureTLS ,
509510 }
@@ -514,12 +515,12 @@ func configureTLS(caCert []byte, insecureTLS bool) (*http.Client, error) {
514515 }
515516 tlsConfig .RootCAs = caCertPool
516517 }
517- rt := http .DefaultTransport .(* http.Transport ).Clone ()
518- rt .TLSClientConfig = tlsConfig
518+ buildableClient := awshttp .NewBuildableClient ().WithTransportOptions (func (tr * http.Transport ) {
519+ tr .TLSClientConfig = tlsConfig
520+ })
521+ // https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/configure-http.html#transport
519522
520- return & http.Client {
521- Transport : rt ,
522- }, nil
523+ return buildableClient , nil
523524}
524525
525526func (b * Blob ) SetPathAsDir (ctx context.Context , path string ) error {
0 commit comments