Browse Source

bugfix: Issue #2831 - Cant connect to frps behind ingress with tls (#2832)

Co-authored-by: Johan Hernefeldt <johan.hernefeldt@moralis.io>
Johan Hernefeldt 3 years ago
parent
commit
eeea7602d9
1 changed files with 2 additions and 1 deletions
  1. 2 1
      pkg/transport/tls.go

+ 2 - 1
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