diff --git a/client/control.go b/client/control.go index 158bc8fb..861c9777 100644 --- a/client/control.go +++ b/client/control.go @@ -18,7 +18,6 @@ import ( "context" "crypto/tls" "fmt" - "github.com/fatedier/frp/models/transport" "io" "net" "runtime/debug" @@ -29,6 +28,7 @@ import ( "github.com/fatedier/frp/models/auth" "github.com/fatedier/frp/models/config" "github.com/fatedier/frp/models/msg" + "github.com/fatedier/frp/models/transport" frpNet "github.com/fatedier/frp/utils/net" "github.com/fatedier/frp/utils/xlog" diff --git a/models/config/client_common.go b/models/config/client_common.go index ec07469b..dd6d3a95 100644 --- a/models/config/client_common.go +++ b/models/config/client_common.go @@ -350,18 +350,15 @@ func (cfg *ClientCommonConf) Check() (err error) { if cfg.TLSEnable == false { if cfg.TLSCertFile != "" { - err = fmt.Errorf("Parse conf error: forbidden tls_cert_file, it only works when tls_enabled is true") - return + fmt.Println("WARNING! Because tls_enable is not true, so tls_cert_file will not make sense") } if cfg.TLSKeyFile != "" { - err = fmt.Errorf("Parse conf error: forbidden tls_key_file, it only works when tls_enabled is true") - return + fmt.Println("WARNING! Because tls_enable is not true, so tls_key_file will not make sense") } if cfg.TLSTrustedCaFile != "" { - err = fmt.Errorf("Parse conf error: forbidden tls_trusted_ca_file, it only works when tls_enabled is true") - return + fmt.Println("WARNING! Because tls_enable is not true, so tls_trusted_ca_file will not make sense") } } diff --git a/models/transport/tls.go b/models/transport/tls.go index c748c004..9338b90d 100644 --- a/models/transport/tls.go +++ b/models/transport/tls.go @@ -76,7 +76,7 @@ func newCertPool(caPath string) (*x509.CertPool, error) { return pool, nil } -func NewServerTLSConfig(certPath, keyPath, caPath string ) (*tls.Config, error) { +func NewServerTLSConfig(certPath, keyPath, caPath string) (*tls.Config, error) { var base = &tls.Config{} if certPath == "" || keyPath == "" { @@ -105,7 +105,6 @@ func NewServerTLSConfig(certPath, keyPath, caPath string ) (*tls.Config, error) return base, nil } - func NewClientTLSConfig(certPath, keyPath, caPath, servearName string) (*tls.Config, error) { var base = &tls.Config{} diff --git a/server/service.go b/server/service.go index 70065412..3880d382 100644 --- a/server/service.go +++ b/server/service.go @@ -19,7 +19,6 @@ import ( "context" "crypto/tls" "fmt" - "github.com/fatedier/frp/models/transport" "io/ioutil" "net" "net/http" @@ -33,6 +32,7 @@ import ( "github.com/fatedier/frp/models/msg" "github.com/fatedier/frp/models/nathole" plugin "github.com/fatedier/frp/models/plugin/server" + "github.com/fatedier/frp/models/transport" "github.com/fatedier/frp/server/controller" "github.com/fatedier/frp/server/group" "github.com/fatedier/frp/server/metrics"