Fix --tlsverify between the CLI and Swarm.

--tlsverify used to be effective only between Swarm and the engines, but
the authentication was not properly functioning with the CLI.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi 2015-02-04 13:14:05 -08:00
parent a0bfcf6733
commit c2d7acf42a
1 changed files with 2 additions and 0 deletions

View File

@ -52,6 +52,8 @@ func loadTlsConfig(ca, cert, key string, verify bool) (*tls.Config, error) {
}
certPool.AppendCertsFromPEM(file)
config.RootCAs = certPool
config.ClientAuth = tls.RequireAndVerifyClientCert
config.ClientCAs = certPool
} else {
// If --tlsverify is not supplied, disable CA validation.
config.InsecureSkipVerify = true