You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pflag.StringVar(&CACert, "cacert", getConfig(config, func() *string { returnconfig.Remote.CACert }, ""), "Path to a custom CA certificate for HTTPS connections.")
163
+
pflag.StringVar(&Cert, "cert", getConfig(config, func() *string { returnconfig.Remote.Cert }, ""), "Path to a client certificate for HTTPS connections.")
164
+
pflag.StringVar(&CertKey, "cert-key", getConfig(config, func() *string { returnconfig.Remote.CertKey }, ""), "Path to a client certificate key for HTTPS connections.")
165
+
pflag.StringVar(&CertKeyPass, "cert-key-pass", getConfig(config, func() *string { returnconfig.Remote.CertKeyPass }, ""), "Passphrase for the client certificate key.")
158
166
}
159
167
pflag.Parse()
160
168
}
@@ -200,6 +208,15 @@ func Validate() error {
200
208
returnerrors.New("task: --nested only applies to --json with --list or --list-all")
201
209
}
202
210
211
+
// Validate certificate flags
212
+
if (Cert!=""&&CertKey=="") || (Cert==""&&CertKey!="") {
213
+
returnerrors.New("task: --cert and --cert-key must be provided together")
214
+
}
215
+
216
+
ifCertKeyPass!=""&&Cert=="" {
217
+
returnerrors.New("task: --cert-key-pass requires --cert and --cert-key")
218
+
}
219
+
203
220
returnnil
204
221
}
205
222
@@ -240,6 +257,10 @@ func (o *flagsOption) ApplyToExecutor(e *task.Executor) {
0 commit comments