From eeea7602d9d130f3fc953a4acaaaa8d1664a04f5 Mon Sep 17 00:00:00 2001 From: Johan Hernefeldt <3883897+presidenten@users.noreply.github.com> Date: Fri, 11 Mar 2022 07:51:47 +0100 Subject: [PATCH] bugfix: Issue #2831 - Cant connect to frps behind ingress with tls (#2832) Co-authored-by: Johan Hernefeldt --- pkg/transport/tls.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/transport/tls.go b/pkg/transport/tls.go index 4a6cd8f5..38201f8e 100644 --- a/pkg/transport/tls.go +++ b/pkg/transport/tls.go @@ -100,6 +100,8 @@ func NewClientTLSConfig(certPath, keyPath, caPath, serverName string) (*tls.Conf base.Certificates = []tls.Certificate{*cert} } + base.ServerName = serverName + if caPath != "" { pool, err := newCertPool(caPath) if err != nil { @@ -107,7 +109,6 @@ func NewClientTLSConfig(certPath, keyPath, caPath, serverName string) (*tls.Conf } base.RootCAs = pool - base.ServerName = serverName base.InsecureSkipVerify = false } else { base.InsecureSkipVerify = true