Skip to content

Commit a059938

Browse files
committed
fix: honor saved insecure TLS setting
Signed-off-by: mynk8 <mr.mayankgame@gmail.com>
1 parent c01f511 commit a059938

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

cmd/login.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ microcks login http://localhost:8080 --sso --sso-launch-browser=false
105105
if keycloakUrl == "null" {
106106
localConfig.UpsertServer(config.Server{
107107
Server: server,
108-
InsecureTLS: true,
108+
InsecureTLS: globalClientOpts.InsecureTLS,
109109
KeycloakEnable: false,
110110
})
111111
fmt.Print("No login required...\n")
@@ -146,7 +146,7 @@ microcks login http://localhost:8080 --sso --sso-launch-browser=false
146146

147147
localConfig.UpsertServer(config.Server{
148148
Server: server,
149-
InsecureTLS: true,
149+
InsecureTLS: globalClientOpts.InsecureTLS,
150150
KeycloakEnable: true,
151151
})
152152
}

pkg/connectors/microcks_client.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ func NewClient(opts ClientOptions) (MicrocksClient, error) {
151151
c.Verbose = opts.Verbose
152152
}
153153

154-
if config.InsecureTLS || len(config.CaCertPaths) > 0 {
154+
if config.InsecureTLS || c.InsecureTLS || len(config.CaCertPaths) > 0 {
155155
tlsConfig := config.CreateTLSConfig()
156+
if c.InsecureTLS {
157+
tlsConfig.InsecureSkipVerify = true
158+
}
156159
tr := &http.Transport{
157160
TLSClientConfig: tlsConfig,
158161
}

0 commit comments

Comments
 (0)