mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5077] [Bug]: Hysteria2 subscription link contains invalid ech parameter and fails in v2rayN/sing-box #3574
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#3574
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 @GrandpaNiuu on GitHub (Jun 8, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5077
Describe the bug
In 3x-ui v3.2.8, when creating a Hysteria2 inbound with TLS enabled, the generated share/subscription link includes an ech= parameter.
The generated Hysteria2 link fails in v2rayN 7.22.5. The latency test shows -1, and the node cannot connect.
However, if I manually remove the ech= parameter from the same Hysteria2 link, the node works normally in v2rayN.
Example generated link:
hysteria2://0123456789abcdef0123456789abcdef@hy2.example.com:443?alpn=h3&ech=AID%2BDQB8AAAgACCRxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&fp=chrome&security=tls&sni=hy2.example.com#US-HY2-Test
After removing ech=, the same node works:
hysteria2://0123456789abcdef0123456789abcdef@hy2.example.com:443?security=tls&sni=hy2.example.com#US-HY2-Test
The generated ECH value seems invalid. After decoding it, it appears to contain a server-side certificate path-like value, for example:
/root/cert/hy2.example.com/fullchain.pem
A local server certificate path should not be included in the client subscription link as part of the ECH configuration.
This issue looks related to Hysteria2 share/subscription link generation, especially the ech parameter.
How to reproduce the problem
Install 3x-ui v3.2.8 on a clean server.
Create a new Hysteria2 inbound.
Enable TLS for the Hysteria2 inbound.
Set the SNI to a normal domain, for example:hy2.example.com
Set the TLS certificate path and private key path, for example:
/root/cert/hy2.example.com/fullchain.pem
/root/cert/hy2.example.com/privkey.pem
Screenshots
No response
3x-ui version
3XUI版本V3.2.8
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu24.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 8, 2026):
Thanks for the detailed report.
What the code does
In
sub/subService.go,genHysteriaLinkincludesech=<value>in the subscription link only whentlsSettings.settings.echConfigListis non-empty in the stored inbound JSON (lines 662–666). This is a new behaviour introduced in v3.2.8 — the release notes explicitly added "End-to-end ECH — now carried in TLS share links, JSON subscriptions" as a feature (commitf8e902a7). In previous versions theechConfigListfield existed in the database but was not emitted into links.Why is
ech=present in your link?The field
tlsSettings.settings.echConfigListin your inbound's stored JSON is non-empty. That field is only set by the "Get New ECH Cert" button in the TLS settings form (thegetNewEchCerthandler infrontend/src/pages/inbounds/form/useSecurityActions.ts). There is no code path that auto-populates it from certificate file paths.Could you confirm:
How to check and fix right now
ech=and should work in v2rayN.About the "cert path" in the decoded value
The value from
xray tls ech --serverName <your-sni>is a proper binary ECH config list (RFC 9180 format). When base64-decoded it contains your domain name (hy2.example.com) as a length-prefixed binary field, along with key material — not a filesystem path. What you saw may be the domain name in the binary context; the data isn't a cert path.Root issue worth filing
If you genuinely never clicked that button on a clean install, that would be a real bug (auto-population of
echConfigList). In that case it would help to share the rawstreamSettingsJSON from your database (sqlite3 /etc/x-ui/x-ui.db "SELECT stream_settings FROM inbounds WHERE id=<your id>") to confirm what is stored.Even if the value was accidentally generated, the fact that including it breaks v2rayN 7.22.5 is a valid concern. The subscription service could conditionally omit
ech=unlessechServerKeysis also non-empty (meaning server-side ECH is actually deployed), but that's a separate enhancement request.@MHSanaei commented on GitHub (Jun 11, 2026):
On current main the
ech=parameter is only emitted when the inbound actually has a non-emptyechConfigListconfigured — both in the subscription service and the panel''s share-link generation. If your link contains anechvalue, ECH was enabled on that inbound (e.g. by clicking "Get New ECH Cert"); clearing the ECH fields in the TLS settings removes the parameter and the link works in v2rayN/sing-box. Closing — please reopen if a link still includesech=with the ECH fields empty on the latest version.