Skip to content

Commit

Permalink
s3: writeGetObjectResponse - convert test to use TLS server.
Browse files Browse the repository at this point in the history
  • Loading branch information
skotambkar committed Oct 15, 2021
1 parent ed523db commit b8c9e38
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package customizations_test
import (
"bytes"
"context"
"crypto/tls"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/s3"
Expand Down Expand Up @@ -191,11 +192,15 @@ func TestWriteGetObjectResponse(t *testing.T) {

for name, tt := range cases {
t.Run(name, func(t *testing.T) {
server := httptest.NewServer(tt.Handler(t))
server := httptest.NewTLSServer(tt.Handler(t))
defer server.Close()

client := s3.New(s3.Options{
Region: "us-west-2",
HTTPClient: &http.Client{
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
},
EndpointResolver: s3.EndpointResolverFunc(func(region string, options s3.EndpointResolverOptions) (aws.Endpoint, error) {
return aws.Endpoint{
URL: server.URL,
Expand Down

0 comments on commit b8c9e38

Please sign in to comment.