fix by comment, later to rebase

This commit is contained in:
yuyulei 2020-09-15 17:13:32 +08:00
parent 09ff73dbdc
commit 02c7a3c8f7
4 changed files with 6 additions and 10 deletions

View File

@ -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"

View File

@ -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")
}
}

View File

@ -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{}

View File

@ -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"