40
40
noPrompt bool
41
41
expEnabled bool
42
42
debugFlag bool
43
+ skipVerifyFlag bool
43
44
kfcUsername string
44
45
kfcHostName string
45
46
kfcPassword string
@@ -112,6 +113,10 @@ func getServerConfigFromFile(configFile string, profile string) (*auth_providers
112
113
return nil , fmt .Errorf ("invalid profile: %s" , profile )
113
114
}
114
115
116
+ if skipVerifyFlag {
117
+ serverConfig .SkipTLSVerify = true
118
+ }
119
+
115
120
log .Debug ().Msg ("return: getServerConfigFromFile()" )
116
121
return & serverConfig , nil
117
122
}
@@ -137,7 +142,9 @@ func getServerConfigFromEnv() (*auth_providers.Server, error) {
137
142
isBasicAuth := uOk && pOk
138
143
isOAuth := cOk && csOk && tOk
139
144
140
- if svOk {
145
+ if skipVerifyFlag {
146
+ skipVerifyBool = true
147
+ } else if svOk {
141
148
//convert to bool
142
149
skipVerify = strings .ToLower (skipVerify )
143
150
skipVerifyBool = skipVerify == "true" || skipVerify == "1" || skipVerify == "yes" || skipVerify == "y" || skipVerify == "t"
@@ -533,6 +540,8 @@ func initClient(saveConfig bool) (*api.Client, error) {
533
540
Str ("providerProfile" , providerProfile ).
534
541
Bool ("noPrompt" , noPrompt ).
535
542
Bool ("saveConfig" , saveConfig ).
543
+ Bool ("logInsecure" , logInsecure ).
544
+ Bool ("skipVerifyFlag" , skipVerifyFlag ).
536
545
Str ("hostname" , kfcHostName ).
537
546
Str ("username" , kfcUsername ).
538
547
Str ("password" , hashSecretValue (kfcPassword )).
@@ -753,6 +762,10 @@ func init() {
753
762
"Will not attempt to connect to GitHub for latest release information and resources." ,
754
763
)
755
764
RootCmd .PersistentFlags ().BoolVar (& debugFlag , "debug" , false , "Enable debugFlag logging." )
765
+ RootCmd .PersistentFlags ().BoolVar (
766
+ & skipVerifyFlag , "skip-tls-verify" , false ,
767
+ "Disable TLS verification for API requests to Keyfactor Command." ,
768
+ )
756
769
//RootCmd.PersistentFlags().BoolVar(
757
770
// &logInsecure,
758
771
// "log-insecure",
0 commit comments