File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,15 @@ func initConfig() {
110
110
caCertPool := x509 .NewCertPool ()
111
111
caCertPool .AppendCertsFromPEM (caCert )
112
112
http .DefaultTransport .(* http.Transport ).TLSClientConfig = & tls.Config {RootCAs : caCertPool }
113
+ } else if config2 .CACert == "" {
114
+ configFilePath := utils .GetLitmusConfigPath (rootCmd )
115
+ obj , err := config2 .YamltoObject (configFilePath )
116
+ cobra .CheckErr (err )
117
+ caCertFile , err := os .ReadFile (obj .CACert )
118
+ cobra .CheckErr (err )
119
+ caCertPool := x509 .NewCertPool ()
120
+ caCertPool .AppendCertsFromPEM (caCertFile )
121
+ http .DefaultTransport .(* http.Transport ).TLSClientConfig = & tls.Config {RootCAs : caCertPool }
113
122
}
114
123
115
124
// If a config file is found, read it in.
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ type LitmuCtlConfig struct {
33
33
CurrentAccount string `yaml:"current-account" json:"current-account"`
34
34
CurrentUser string `yaml:"current-user" json:"current-user"`
35
35
Kind string `yaml:"kind" json:"kind"`
36
+ CACert string `yaml:"cacert" json:"cacert"`
36
37
}
37
38
38
39
type Current struct {
You can’t perform that action at this time.
0 commit comments