File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,6 @@ func (c *Session) connect() error {
58
58
59
59
// Build auth options
60
60
if c .opts .User != "" {
61
-
62
61
rootCertPemData , err := ioutil .ReadFile (c .opts .CARootCert )
63
62
if err != nil {
64
63
return errors .New ("Opening CARootCert: " + err .Error ())
@@ -70,7 +69,6 @@ func (c *Session) connect() error {
70
69
}
71
70
72
71
tlsConf := & tls.Config {
73
- ServerName : "localhost" ,
74
72
InsecureSkipVerify : true ,
75
73
RootCAs : rootCertPool ,
76
74
}
@@ -96,6 +94,12 @@ func (c *Session) connect() error {
96
94
address = address + ":" + strconv .FormatUint (uint64 (port ), 10 )
97
95
}
98
96
97
+ // Set ServerName based on the address we're connecting to
98
+ if authOptions != nil {
99
+ addressWithoutPort := address [0 :strings .Index (address , ":" )]
100
+ authOptions .TlsConfig .ServerName = addressWithoutPort
101
+ }
102
+
99
103
node , err := riak .NewNode (& riak.NodeOptions {
100
104
RemoteAddress : address ,
101
105
AuthOptions : authOptions ,
You can’t perform that action at this time.
0 commit comments