Skip to content

Commit

Permalink
set transport to skip verify if se skip flag passed (k3s-io#4102)
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Downs <brian.downs@gmail.com>
  • Loading branch information
briandowns committed Sep 28, 2021
1 parent bc6ad5a commit a677f74
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/etcd/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,18 @@ type s3 struct {
// a new Minio client.
func newS3(ctx context.Context, config *config.Control) (*s3, error) {
tr := http.DefaultTransport
if config.EtcdS3EndpointCA != "" {

switch {
case config.EtcdS3EndpointCA != "":
trCA, err := setTransportCA(tr, config.EtcdS3EndpointCA, config.EtcdS3SkipSSLVerify)
if err != nil {
return nil, err
}
tr = trCA
case config.EtcdS3 && config.EtcdS3SkipSSLVerify:
tr.(*http.Transport).TLSClientConfig = &tls.Config{
InsecureSkipVerify: config.EtcdS3SkipSSLVerify,
}
}

var creds *credentials.Credentials
Expand Down

0 comments on commit a677f74

Please sign in to comment.