Skip to content

Commit

Permalink
feat: add insecure to trust self-signed certificates (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
chengxiangdong committed Jan 20, 2025
1 parent 3e0a52f commit 92ae73a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/config/cloud.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
"crypto/tls"
"fmt"
"net/http"

Expand All @@ -20,6 +21,7 @@ type CloudCredentials struct {
Cloud string `gcfg:"cloud"`
AuthURL string `gcfg:"auth-url"`
Region string `gcfg:"region"`
Insecure bool `gcfg:"insecure"`
AccessKey string `gcfg:"access-key"`
SecretKey string `gcfg:"secret-key"`
ProjectID string `gcfg:"project-id"`
Expand Down Expand Up @@ -135,7 +137,14 @@ func (c *CloudCredentials) newCloudClient() error {
return err
}

transport := &http.Transport{Proxy: http.ProxyFromEnvironment}
transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS12,
InsecureSkipVerify: c.Global.Insecure,
},
}

client.HTTPClient = http.Client{
Transport: &utils.LogRoundTripper{
Rt: transport,
Expand Down

0 comments on commit 92ae73a

Please sign in to comment.