Skip to content

Commit 92ae73a

Browse files
feat: add insecure to trust self-signed certificates (#155)
1 parent 3e0a52f commit 92ae73a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pkg/config/cloud.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package config
22

33
import (
4+
"crypto/tls"
45
"fmt"
56
"net/http"
67

@@ -20,6 +21,7 @@ type CloudCredentials struct {
2021
Cloud string `gcfg:"cloud"`
2122
AuthURL string `gcfg:"auth-url"`
2223
Region string `gcfg:"region"`
24+
Insecure bool `gcfg:"insecure"`
2325
AccessKey string `gcfg:"access-key"`
2426
SecretKey string `gcfg:"secret-key"`
2527
ProjectID string `gcfg:"project-id"`
@@ -135,7 +137,14 @@ func (c *CloudCredentials) newCloudClient() error {
135137
return err
136138
}
137139

138-
transport := &http.Transport{Proxy: http.ProxyFromEnvironment}
140+
transport := &http.Transport{
141+
Proxy: http.ProxyFromEnvironment,
142+
TLSClientConfig: &tls.Config{
143+
MinVersion: tls.VersionTLS12,
144+
InsecureSkipVerify: c.Global.Insecure,
145+
},
146+
}
147+
139148
client.HTTPClient = http.Client{
140149
Transport: &utils.LogRoundTripper{
141150
Rt: transport,

0 commit comments

Comments
 (0)