Skip to content

Commit 2ce9948

Browse files
author
Jayson Wang
committed
Allow insecure server connections
1 parent 80d8bdf commit 2ce9948

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

cliclient/cliclient.go

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ func createClientOpts(config *config.ServerConfig) *clientbase.ClientOpts {
185185
AccessKey: config.AccessKey,
186186
SecretKey: config.SecretKey,
187187
CACerts: config.CACerts,
188+
Insecure: config.Insecure,
188189
}
189190
return options
190191
}

cmd/login.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ func LoginCommand() cli.Command {
6161
Name: "skip-verify",
6262
Usage: "Skip verification of the CACerts presented by the Server",
6363
},
64+
cli.BoolFlag{
65+
Name: "insecure",
66+
Usage: "Allow insecure server connections",
67+
},
6468
},
6569
}
6670
}
@@ -80,7 +84,9 @@ func loginSetup(ctx *cli.Context) error {
8084
serverName = "rancherDefault"
8185
}
8286

83-
serverConfig := &config.ServerConfig{}
87+
serverConfig := &config.ServerConfig{
88+
Insecure: ctx.Bool("insecure"),
89+
}
8490

8591
// Validate the url and drop the path
8692
u, err := url.ParseRequestURI(ctx.Args().First())

config/config.go

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type ServerConfig struct {
3030
CACerts string `json:"cacert"`
3131
KubeCredentials map[string]*ExecCredential `json:"kubeCredentials"`
3232
KubeConfigs map[string]*api.Config `json:"kubeConfigs"`
33+
Insecure bool `json:"insecure"`
3334
}
3435

3536
func (c Config) Write() error {

0 commit comments

Comments
 (0)