XTLS Vision checks outer TLS version (#1554)

This commit is contained in:
yuhan6665 2023-01-26 22:43:58 -05:00 committed by GitHub
parent 3fb67f065a
commit fb212905bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View file

@ -5,6 +5,7 @@ package inbound
import (
"bytes"
"context"
gotls "crypto/tls"
"io"
"reflect"
"strconv"
@ -470,6 +471,9 @@ func (h *Handler) Process(ctx context.Context, network net.Network, connection s
var t reflect.Type
var p uintptr
if tlsConn, ok := iConn.(*tls.Conn); ok {
if tlsConn.ConnectionState().Version != gotls.VersionTLS13 {
return newError(`failed to use ` + requestAddons.Flow + `, found outer tls version `, tlsConn.ConnectionState().Version).AtWarning()
}
netConn = tlsConn.NetConn()
if pc, ok := netConn.(*proxyproto.Conn); ok {
netConn = pc.Raw()