Add support of user self signed certificates

Additionally add documentation about how to configure TLS with Minio
This commit is contained in:
Anis Elleuch
2016-11-11 16:18:44 +01:00
committed by Harshavardhana
parent e216201901
commit 6512d9978e
7 changed files with 273 additions and 58 deletions

View File

@@ -81,9 +81,10 @@ func (rpcClient *RPCClient) dialRPCClient() (*rpc.Client, error) {
hostname, _, splitErr := net.SplitHostPort(rpcClient.node)
if splitErr != nil {
return nil, errors.New("Unable to parse RPC address <" + rpcClient.node + "> : " + splitErr.Error())
}
// ServerName in tls.Config needs to be specified to support SNI certificates
conn, err = tls.Dial("tcp", rpcClient.node, &tls.Config{ServerName: hostname})
conn, err = tls.Dial("tcp", rpcClient.node, &tls.Config{ServerName: hostname, RootCAs: globalRootCAs})
} else {
// Have a dial timeout with 3 secs.
conn, err = net.DialTimeout("tcp", rpcClient.node, 3*time.Second)