Skip to content

Commit

Permalink
Merge pull request #5210 from antonkurbatov/bugfix/magnum-tls-insecure
Browse files Browse the repository at this point in the history
magnum: add an option to create insecure TLS connections
  • Loading branch information
k8s-ci-robot authored Oct 5, 2022
2 parents ddf0fe0 + 4491403 commit c65a3a3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ type Config struct {
DomainName string `gcfg:"domain-name"`
Region string
CAFile string `gcfg:"ca-file"`
TLSInsecure string `gcfg:"tls-insecure"`
SecretName string `gcfg:"secret-name"`
SecretNamespace string `gcfg:"secret-namespace"`
}
Expand Down Expand Up @@ -169,15 +170,16 @@ func createProviderClient(cfg *Config, opts config.AutoscalingOptions) (*gopherc

klog.V(5).Infof("Using user-agent %q", userAgent.Join())

config := &tls.Config{}
config.InsecureSkipVerify = cfg.Global.TLSInsecure == "true"
if cfg.Global.CAFile != "" {
roots, err := certutil.NewPool(cfg.Global.CAFile)
if err != nil {
return nil, err
}
config := &tls.Config{}
config.RootCAs = roots
provider.HTTPClient.Transport = netutil.SetOldTransportDefaults(&http.Transport{TLSClientConfig: config})
}
provider.HTTPClient.Transport = netutil.SetOldTransportDefaults(&http.Transport{TLSClientConfig: config})

err = openstack.AuthenticateV3(provider, authOpts, gophercloud.EndpointOpts{})
if err != nil {
Expand Down

0 comments on commit c65a3a3

Please sign in to comment.