mirror of
https://github.com/minio/minio.git
synced 2025-01-23 12:43:16 -05:00
Add ssl support to s3/web peers connections (#2988)
This commit is contained in:
parent
39331b6b4e
commit
bbba8e432a
@ -19,6 +19,7 @@ package cmd
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
|
"crypto/x509"
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
@ -83,6 +84,11 @@ func (rpcClient *RPCClient) dialRPCClient() (*rpc.Client, error) {
|
|||||||
conn, err = net.DialTimeout("tcp", rpcClient.node, 3*time.Second)
|
conn, err = net.DialTimeout("tcp", rpcClient.node, 3*time.Second)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// Print RPC connection errors that are worthy to display in log
|
||||||
|
switch err.(type) {
|
||||||
|
case x509.HostnameError:
|
||||||
|
errorIf(err, "Unable to establish RPC to %s", rpcClient.node)
|
||||||
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
io.WriteString(conn, "CONNECT "+rpcClient.rpcPath+" HTTP/1.0\n\n")
|
io.WriteString(conn, "CONNECT "+rpcClient.rpcPath+" HTTP/1.0\n\n")
|
||||||
|
@ -87,6 +87,7 @@ func (s3p *s3Peers) InitS3PeerClient(peer string) {
|
|||||||
accessKey: serverConfig.GetCredential().AccessKeyID,
|
accessKey: serverConfig.GetCredential().AccessKeyID,
|
||||||
secretKey: serverConfig.GetCredential().SecretAccessKey,
|
secretKey: serverConfig.GetCredential().SecretAccessKey,
|
||||||
address: peer,
|
address: peer,
|
||||||
|
secureConn: isSSL(),
|
||||||
path: path.Join(reservedBucket, s3Path),
|
path: path.Join(reservedBucket, s3Path),
|
||||||
loginMethod: "S3.LoginHandler",
|
loginMethod: "S3.LoginHandler",
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,7 @@ func updateCredsOnPeers(creds credential) map[string]error {
|
|||||||
accessKey: serverConfig.GetCredential().AccessKeyID,
|
accessKey: serverConfig.GetCredential().AccessKeyID,
|
||||||
secretKey: serverConfig.GetCredential().SecretAccessKey,
|
secretKey: serverConfig.GetCredential().SecretAccessKey,
|
||||||
address: peers[ix],
|
address: peers[ix],
|
||||||
|
secureConn: isSSL(),
|
||||||
path: path.Join(reservedBucket, browserPath),
|
path: path.Join(reservedBucket, browserPath),
|
||||||
loginMethod: "Browser.LoginHandler",
|
loginMethod: "Browser.LoginHandler",
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user