Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

Commit

Permalink
GCS: Use default HTTP client when endpoint is not set. Fixes #137.
Browse files Browse the repository at this point in the history
  • Loading branch information
atombender committed Sep 14, 2020
1 parent 16a4904 commit 64f5834
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions storage/backend/gcs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ func New(l log.Logger, c Config) (*Backend, error) {

if c.Endpoint != "" {
opts = append(opts, option.WithEndpoint(c.Endpoint))
}

if !strings.HasPrefix(c.Endpoint, "https://") { // This is not settable from outside world, only used for mock tests.
opts = append(opts, option.WithHTTPClient(&http.Client{Transport: &http.Transport{
// ignore unverified/expired SSL certificates for tests.
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, //nolint:gosec
}}))
if !strings.HasPrefix(c.Endpoint, "https://") { // This is not settable from outside world, only used for mock tests.
opts = append(opts, option.WithHTTPClient(&http.Client{Transport: &http.Transport{
// ignore unverified/expired SSL certificates for tests.
TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, //nolint:gosec
}}))
}
}

setAuthenticationMethod(l, c, opts)
opts = setAuthenticationMethod(l, c, opts)

ctx, cancel := context.WithTimeout(context.Background(), c.Timeout)
defer cancel()
Expand Down

0 comments on commit 64f5834

Please sign in to comment.