[GH-ISSUE #5617] [Bug]: VLESS REALITY: Custom Target/SNI Configuration Causes Client Connection Failure #3919

Closed
opened 2026-10-31 20:35:53 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @shazzreab on GitHub (Jun 27, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5617

Describe the bug

I am using the VLESS protocol with REALITY encryption on port 443. The Target/SNI values are manually set by me instead of using the randomly generated ones provided by the panel. After creating the node, the client becomes unavailable. However, after modifying the Target/SNI settings, it returns to normal. I did not encounter this issue in previous versions, but it started from version 3.4.0 and still exists in 3.4.1.
I am not entirely sure whether the issue is caused by the custom Target and SNI settings. However, after modifying the Target and SNI, the connection returned to normal.
The custom Target and SNI values I used are:
www.apple.com
dash.cloudflare.com
www.cloudflare.com
www.microsoft.com

How to reproduce the problem

修改Target/SNI

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.4.1

Xray-core version

26.6.22

How did you install 3x-ui?

install.sh script

Operating system

Ubntu 24

Which parts of the panel are affected?

Xray config generation

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

None

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @shazzreab on GitHub (Jun 27, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5617 ### Describe the bug I am using the VLESS protocol with REALITY encryption on port 443. The Target/SNI values are manually set by me instead of using the randomly generated ones provided by the panel. After creating the node, the client becomes unavailable. However, after modifying the Target/SNI settings, it returns to normal. I did not encounter this issue in previous versions, but it started from version 3.4.0 and still exists in 3.4.1. I am not entirely sure whether the issue is caused by the custom Target and SNI settings. However, after modifying the Target and SNI, the connection returned to normal. The custom Target and SNI values I used are: www.apple.com dash.cloudflare.com www.cloudflare.com www.microsoft.com ### How to reproduce the problem 修改Target/SNI ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.4.1 ### Xray-core version 26.6.22 ### How did you install 3x-ui? install.sh script ### Operating system Ubntu 24 ### Which parts of the panel are affected? Xray config generation ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? None ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:35:53 +07:00
Author
Owner

@shazzreab commented on GitHub (Jun 27, 2026):

This issue does not appear immediately after setup, but occurs after 3–5 days of use. Right after configuration, everything works normally for all users.

<!-- gh-comment-id:4819449848 --> @shazzreab commented on GitHub (Jun 27, 2026): This issue does not appear immediately after setup, but occurs after 3–5 days of use. Right after configuration, everything works normally for all users.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 27, 2026):

Two likely causes are worth checking, in order of probability.

1. SNI values not confirmed as tags (most likely cause of the regression)

In v3.4.0 the SNI field (serverNames) was moved to an Ant Design <Select mode="tags"> component (frontend/src/pages/inbounds/form/security/reality.tsx). In this control, typing a domain name is not enough — each value must be confirmed by pressing Enter or comma before clicking Save. Text left in the input box without being confirmed is silently discarded.

If serverNames is saved as an empty array ([]), xray-core receives a REALITY inbound with no accepted SNI values and will reject every client handshake. Opening the settings modal and re-saving with the same values (but this time pressing Enter after each SNI to confirm the tag) would explain why the connection is restored after the "modification" step.

To verify: after saving an inbound, open Inbound → Export JSON (or the panel's config-template preview) and look at the stored streamSettings. If you see "serverNames": [], this is the problem.

2. Target must include a port suffix

The panel validates the Target field and requires a port (frontend/src/lib/xray/stream-wire-normalize.ts:77-109). The entry must be in the form example.com:443, not example.com alone. The placeholder in the form also shows example.com:443. If the Target was entered without a port, the form would display a validation error, but it is worth confirming the exact value used.


Information needed to confirm the root cause

Please provide:

  1. The xray-core log at the time the client is unavailable. On a standard install it is at:

    /var/log/x-ui/xray.log
    

    or accessible via the panel's log viewer. Look for REALITY or TLS-related error lines.

  2. The stored streamSettings JSON for the failing inbound. You can retrieve it by running:

    sqlite3 /etc/x-ui/x-ui.db "SELECT stream_settings FROM inbounds WHERE remark='<your inbound name>';"
    

    Redact the private key before posting, but include realitySettings.target, realitySettings.serverNames, and realitySettings.shortIds.

  3. Whether "modifying Target/SNI" means you re-saved without changing any values, or you changed the values. If only a re-save, the SNI tag-confirmation hypothesis above is the most likely explanation.


This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4819490777 --> @github-actions[bot] commented on GitHub (Jun 27, 2026): Two likely causes are worth checking, in order of probability. **1. SNI values not confirmed as tags (most likely cause of the regression)** In v3.4.0 the SNI field (`serverNames`) was moved to an Ant Design `<Select mode="tags">` component ([`frontend/src/pages/inbounds/form/security/reality.tsx`](https://github.com/MHSanaei/3x-ui/blob/main/frontend/src/pages/inbounds/form/security/reality.tsx#L117-L119)). In this control, typing a domain name is **not enough** — each value must be confirmed by pressing **Enter** or **comma** before clicking Save. Text left in the input box without being confirmed is silently discarded. If `serverNames` is saved as an empty array (`[]`), xray-core receives a REALITY inbound with no accepted SNI values and will reject every client handshake. Opening the settings modal and re-saving with the same values (but this time pressing Enter after each SNI to confirm the tag) would explain why the connection is restored after the "modification" step. To verify: after saving an inbound, open **Inbound → Export JSON** (or the panel's config-template preview) and look at the stored `streamSettings`. If you see `"serverNames": []`, this is the problem. **2. Target must include a port suffix** The panel validates the Target field and requires a port ([`frontend/src/lib/xray/stream-wire-normalize.ts:77-109`](https://github.com/MHSanaei/3x-ui/blob/main/frontend/src/lib/xray/stream-wire-normalize.ts#L77-L109)). The entry must be in the form `example.com:443`, not `example.com` alone. The placeholder in the form also shows `example.com:443`. If the Target was entered without a port, the form would display a validation error, but it is worth confirming the exact value used. --- **Information needed to confirm the root cause** Please provide: 1. The xray-core log at the time the client is unavailable. On a standard install it is at: ``` /var/log/x-ui/xray.log ``` or accessible via the panel's log viewer. Look for REALITY or TLS-related error lines. 2. The stored `streamSettings` JSON for the failing inbound. You can retrieve it by running: ```bash sqlite3 /etc/x-ui/x-ui.db "SELECT stream_settings FROM inbounds WHERE remark='<your inbound name>';" ``` Redact the private key before posting, but include `realitySettings.target`, `realitySettings.serverNames`, and `realitySettings.shortIds`. 3. Whether "modifying Target/SNI" means you re-saved **without changing any values**, or you **changed the values**. If only a re-save, the SNI tag-confirmation hypothesis above is the most likely explanation. --- *This reply was generated automatically; a maintainer may follow up.*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3919
No description provided.