mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5578] [Bug]: CDN Fake SNI broken after allowInsecure removal due to missing Certificate Path fields in "Edit Host" #3897
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3897
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @solidwar on GitHub (Jun 26, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5578
Describe the bug
With the upcoming removal of allowInsecure from the Xray core, configurations using CDN with a Fake SNI on port 443 will completely stop working.
To bypass censorship, we need to utilize both port 80 (HTTP) and port 443 (TLS) simultaneously via the Edit Host feature. We CANNOT simply set the main Inbound port to 443, because the main Inbound port must be set to a custom port (e.g., 1111) to match the backend port configured in the CDN (like Fastly).
Since the main Inbound is HTTP/Cleartext on port 1111, we use the Edit Host section to map client connections to ports 80 and 443. However, there is currently no way to provide an SSL certificate for the 443 host configuration inside the "Edit Host" menu. Previously, allowInsecure masked the lack of a real certificate on port 443, but now it causes an immediate handshake failure.
How to reproduce the problem
Create a VLESS/VMess Inbound with a custom port (e.g., 1111) and leave TLS disabled (required for CDN/Fastly backend routing).
Go to the Edit Host section of that Inbound.
Add a host for port 80 (No TLS).
Add another host for port 443, enable TLS, and set a Fake SNI (e.g., speedtest.net).
Notice that there are no fields in the "Edit Host" menu to specify the actual SSL Certificate and Key paths (.crt / .key) for this 443 host.
When allowInsecure is disabled, the connection fails immediately because the server has no certificate to present to the client on port 443.
Expected behavior
When TLS is enabled inside the Edit Host menu, there should be dedicated fields to specify the Certificate File Path and Key File Path for that specific host configuration.
This will allow the server to correctly present its real domain certificate on port 443 (while the main inbound remains on the custom port 1111), enabling the client to securely verify the connection via verifyPeerCertByName without depending on the deprecated allowInsecure option.
Actual behavior
The SSL Certificate/Key path fields are only available in the main Inbound settings. Since the main Inbound must stay on the custom port 1111 for CDN routing, there is no way to load a real SSL certificate for the 443 host configuration, making Fake SNI over CDN completely broken in newer Xray core versions.
Relevant logs
Screenshots
3x-ui version
3.4.1
Xray-core version
v26.6.22
How did you install 3x-ui?
install.sh script
Operating system
ubuntu 22.04
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 26, 2026):
The feature request in this issue rests on a misunderstanding of what the Edit Host section does, which is why the certificate-path fields you are looking for do not exist there.
What Edit Host actually does
Edit Host entries are persisted in the
Hosttable (internal/database/model/model.go) and converted toexternalProxyentries byinternal/sub/host_sub.go. These are entirely client-side parameters: they get embedded into subscription links and tell connecting clients which address, port, and TLS settings to use when dialling out. They never touch the Xray server's listener configuration.certFileandkeyFileare server-side inbound fields. They tell Xray what TLS certificate to load and present to incoming connections. They live on the inbound'stlsSettings.certificates[]array, not on client overrides. Adding them to an Edit Host entry would have no meaning in Xray's architecture — the host entry has no influence over what certificate the server presents.The actual replacement for
allowInsecureThe field you need already exists in the Edit Host form. It is called "Verify Peer Cert By Name" (
verifyPeerCertByName), rendered at line 227 offrontend/src/pages/hosts/HostFormModal.tsx. Its tooltip in the English locale (internal/web/translation/en-US.json, line 617) reads:When set, this value is serialised into subscription links as the
vcnparameter and injected into the client-sidetlsSettings.settings.verifyPeerCertByNamefor JSON subscriptions (internal/sub/service.go, lines 1421–1427). It is the upstream replacement forallowInsecure.How to fix your CDN/Fake SNI setup
In your scenario the CDN (Fastly) terminates TLS on port 443 and presents its own certificate to the client.
allowInsecurewas skipping verification of that certificate. To restore connectivity withoutallowInsecure:This makes
allowInsecureunnecessary for your use case. TheallowInsecuretoggle is still visible in the Edit Host form for compatibility, but Xray removed its client-side effect after 2026-06-01, so setting it no longer bypasses certificate errors on Xray v26.6.x and later.If the CDN's certificate does not cover any predictable name (e.g. it serves an ephemeral shared cert), you can use
pinnedPeerCertSha256in the same Edit Host form to pin verification by certificate fingerprint instead.This reply was generated automatically; a maintainer may follow up.