add e2e tests for v1 config (#3608)

This commit is contained in:
fatedier
2023-09-13 16:32:39 +08:00
committed by GitHub
parent c95311d1a0
commit 7cd02f5bd8
61 changed files with 3697 additions and 159 deletions

View File

@@ -86,7 +86,7 @@ func (svr *Service) APIServerInfo(w http.ResponseWriter, r *http.Request) {
MaxPortsPerClient: svr.cfg.MaxPortsPerClient,
HeartBeatTimeout: svr.cfg.Transport.HeartbeatTimeout,
AllowPortsStr: types.PortsRangeSlice(svr.cfg.AllowPorts).String(),
TLSOnly: svr.cfg.TLS.Force,
TLSOnly: svr.cfg.Transport.TLS.Force,
TotalTrafficIn: serverStats.TotalTrafficIn,
TotalTrafficOut: serverStats.TotalTrafficOut,

View File

@@ -108,9 +108,9 @@ type Service struct {
func NewService(cfg *v1.ServerConfig) (svr *Service, err error) {
tlsConfig, err := transport.NewServerTLSConfig(
cfg.TLS.CertFile,
cfg.TLS.KeyFile,
cfg.TLS.TrustedCaFile)
cfg.Transport.TLS.CertFile,
cfg.Transport.TLS.KeyFile,
cfg.Transport.TLS.TrustedCaFile)
if err != nil {
return
}
@@ -455,7 +455,7 @@ func (svr *Service) HandleListener(l net.Listener) {
log.Trace("start check TLS connection...")
originConn := c
var isTLS, custom bool
c, isTLS, custom, err = utilnet.CheckAndEnableTLSServerConnWithTimeout(c, svr.tlsConfig, svr.cfg.TLS.Force, connReadTimeout)
c, isTLS, custom, err = utilnet.CheckAndEnableTLSServerConnWithTimeout(c, svr.tlsConfig, svr.cfg.Transport.TLS.Force, connReadTimeout)
if err != nil {
log.Warn("CheckAndEnableTLSServerConnWithTimeout error: %v", err)
originConn.Close()