mirror of https://github.com/fatedier/frp.git
fix create tls work connection (#2013)
This commit is contained in:
parent
ef5ae3e598
commit
0f8040b875
|
@ -211,10 +211,11 @@ func (ctl *Control) connectServer() (conn net.Conn, err error) {
|
||||||
var tlsConfig *tls.Config
|
var tlsConfig *tls.Config
|
||||||
|
|
||||||
if ctl.clientCfg.TLSEnable {
|
if ctl.clientCfg.TLSEnable {
|
||||||
tlsConfig, err = transport.NewServerTLSConfig(
|
tlsConfig, err = transport.NewClientTLSConfig(
|
||||||
ctl.clientCfg.TLSCertFile,
|
ctl.clientCfg.TLSCertFile,
|
||||||
ctl.clientCfg.TLSKeyFile,
|
ctl.clientCfg.TLSKeyFile,
|
||||||
ctl.clientCfg.TLSTrustedCaFile)
|
ctl.clientCfg.TLSTrustedCaFile,
|
||||||
|
ctl.clientCfg.ServerAddr)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
xl.Warn("fail to build tls configuration when connecting to server, err: %v", err)
|
xl.Warn("fail to build tls configuration when connecting to server, err: %v", err)
|
||||||
|
|
Loading…
Reference in New Issue