From a1bf968be975adefa9247d7b3093613cee82f028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Wed, 9 Sep 2026 02:18:12 +0800 Subject: [PATCH] VLESS config: Fix validateOutboundTransportSecurity() (#6741) Fixes https://github.com/XTLS/Xray-core/issues/6737#issuecomment-5587270250 --- infra/conf/vless.go | 3 +++ infra/conf/xray.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/infra/conf/vless.go b/infra/conf/vless.go index 1c8ababfd..1e435d900 100644 --- a/infra/conf/vless.go +++ b/infra/conf/vless.go @@ -312,6 +312,9 @@ func (c *VLessOutboundConfig) Build() (proto.Message, error) { if err := json.Unmarshal(rawUser, account); err != nil { return nil, errors.New(`VLESS users: invalid user`).Base(err) } + // validateOutboundTransportSecurity needs to see these + c.Encryption = account.Encryption + c.Address = rec.Address if account.Reverse != nil { // may not be reached: error json unmarshal return nil, errors.New(`VLESS users: please use simplified outbound's config style to use "reverse"`) } diff --git a/infra/conf/xray.go b/infra/conf/xray.go index 0643a54f0..be37cffe7 100644 --- a/infra/conf/xray.go +++ b/infra/conf/xray.go @@ -242,7 +242,7 @@ func validateOutboundTransportSecurity(rawConfig interface{}, senderSettings *pr if vlessCfg.Encryption != "" && vlessCfg.Encryption != "none" { return nil } - if requiresTransportSecurity(vlessCfg.Vnext[0].Address) { + if requiresTransportSecurity(vlessCfg.Address) { return errors.New("vless without TLS or other encryption is prohibited unless the server address is a private IP or domain") } }