fix: handle decryption handshake errors in server

This commit is contained in:
wwqgtxx committed 2026-09-14 11:24:37 +08:00
1 parent c210be21e0
commit 1cdca1a015
1 file changed
+3 -2
+3 -2
View File
@@ -328,11 +328,12 @@ func (l *Listener) AddrList() (addrList []net.Addr) {
func (l *Listener) HandleConn(conn net.Conn, tunnel C.Tunnel, additions ...inbound.Addition) {
ctx := sing.WithAdditions(context.TODO(), additions...)
if l.decryption != nil {
var err error
conn, err = l.decryption.Handshake(conn, nil)
c, err := l.decryption.Handshake(conn, nil)
if err != nil {
_ = conn.Close()
return
}
conn = c
}
err := l.service.NewConnection(ctx, conn, metadata.Metadata{
Protocol: "vless",