Browse Source

fix create tls work connection (#2013)

pull/2018/head
lonwern 4 years ago committed by GitHub
parent
commit
0f8040b875
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      client/control.go

5
client/control.go

@ -211,10 +211,11 @@ func (ctl *Control) connectServer() (conn net.Conn, err error) {
var tlsConfig *tls.Config
if ctl.clientCfg.TLSEnable {
tlsConfig, err = transport.NewServerTLSConfig(
tlsConfig, err = transport.NewClientTLSConfig(
ctl.clientCfg.TLSCertFile,
ctl.clientCfg.TLSKeyFile,
ctl.clientCfg.TLSTrustedCaFile)
ctl.clientCfg.TLSTrustedCaFile,
ctl.clientCfg.ServerAddr)
if err != nil {
xl.Warn("fail to build tls configuration when connecting to server, err: %v", err)

Loading…
Cancel
Save