Skip to content

Commit

Permalink
fix create tls work connection (fatedier#2013)
Browse files Browse the repository at this point in the history
  • Loading branch information
lonwern authored Sep 29, 2020
1 parent ef5ae3e commit 0f8040b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0f8040b

Please sign in to comment.