Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions pkg/blob/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
api "kmodules.xyz/objectstore-api/api/v1"

aws2 "github.com/aws/aws-sdk-go-v2/aws"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/s3"
Expand Down Expand Up @@ -503,7 +504,7 @@ func (b *Blob) getS3Config(ctx context.Context, debug bool) (aws2.Config, error)
return config.LoadDefaultConfig(ctx, loadOptions...)
}

func configureTLS(caCert []byte, insecureTLS bool) (*http.Client, error) {
func configureTLS(caCert []byte, insecureTLS bool) (*awshttp.BuildableClient, error) {
tlsConfig := &tls.Config{
InsecureSkipVerify: insecureTLS,
}
Expand All @@ -514,12 +515,12 @@ func configureTLS(caCert []byte, insecureTLS bool) (*http.Client, error) {
}
tlsConfig.RootCAs = caCertPool
}
rt := http.DefaultTransport.(*http.Transport).Clone()
rt.TLSClientConfig = tlsConfig
buildableClient := awshttp.NewBuildableClient().WithTransportOptions(func(tr *http.Transport) {
tr.TLSClientConfig = tlsConfig
})
// https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/configure-http.html#transport

return &http.Client{
Transport: rt,
}, nil
return buildableClient, nil
}

func (b *Blob) SetPathAsDir(ctx context.Context, path string) error {
Expand Down
Loading