Skip to content

Commit

Permalink
Merge pull request #527 from akutz/bugfix/tls-insecure-parsing
Browse files Browse the repository at this point in the history
Fix for TLS Insecure Parsing
  • Loading branch information
akutz committed Apr 30, 2017
2 parents d414c47 + e65dce0 commit 1ee78da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/utils/utils_tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func ParseTLSConfig(
if strings.EqualFold(v, "insecure") {
f(types.ConfigTLS, "insecure")
newTLS(types.ConfigTLS, "insecure")
tlsConfig.InsecureSkipVerify = true

// check to see if TLS is enabled with peers
} else if strings.EqualFold(v, "verifyPeers") {
Expand Down Expand Up @@ -147,7 +148,6 @@ func ParseTLSConfig(
newTLS(types.ConfigTLSClientCertRequired, true)
f(types.ConfigTLSClientCertRequired, true)
tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert
f(types.ConfigTLSClientCertRequired, true)
}

if v := getString(config, types.ConfigTLSServerName, roots...); v != "" {
Expand Down Expand Up @@ -182,6 +182,7 @@ func ParseTLSConfig(
f(types.ConfigTLSKnownHosts, khFile)
tlsConfig.SysKnownHosts = khFile
tlsConfig.VerifyPeers = true
tlsConfig.InsecureSkipVerify = true

return nil
}(); err != nil {
Expand Down

0 comments on commit 1ee78da

Please sign in to comment.