TlsOnly - only accept TLS connections if enabled

This commit is contained in:
Guy Lewin
2020-02-10 18:56:41 +02:00
parent c8748a2948
commit c747f160aa
3 changed files with 17 additions and 2 deletions

View File

@ -284,7 +284,7 @@ func (svr *Service) HandleListener(l net.Listener) {
log.Trace("start check TLS connection...")
originConn := c
c, err = frpNet.CheckAndEnableTLSServerConnWithTimeout(c, svr.tlsConfig, connReadTimeout)
c, err = frpNet.CheckAndEnableTLSServerConnWithTimeout(c, svr.tlsConfig, svr.cfg.TlsOnly, connReadTimeout)
if err != nil {
log.Warn("CheckAndEnableTLSServerConnWithTimeout error: %v", err)
originConn.Close()