File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -384,18 +384,19 @@ func (c *Conn) identify() (*IdentifyResponse, error) {
384
384
}
385
385
386
386
func (c * Conn ) upgradeTLS (tlsConf * tls.Config ) error {
387
- // create a local copy of the config to set ServerName for this connection
388
- var conf tls.Config
389
- if tlsConf != nil {
390
- conf = * tlsConf
391
- }
392
387
host , _ , err := net .SplitHostPort (c .addr )
393
388
if err != nil {
394
389
return err
395
390
}
391
+
392
+ // create a local copy of the config to set ServerName for this connection
393
+ conf := & tls.Config {}
394
+ if tlsConf != nil {
395
+ conf = tlsConf .Clone ()
396
+ }
396
397
conf .ServerName = host
397
398
398
- c .tlsConn = tls .Client (c .conn , & conf )
399
+ c .tlsConn = tls .Client (c .conn , conf )
399
400
err = c .tlsConn .Handshake ()
400
401
if err != nil {
401
402
return err
You can’t perform that action at this time.
0 commit comments