mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4097] ECH config generated for Hysteria2 inbound has empty public_name, causing RFC 9180 violation and connection failure in sing-box clients #2778
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#2778
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 @cat-of-summer on GitHub (Apr 24, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4097
Describe the bug
When creating a Hysteria2 inbound with ECH (Encrypted Client Hello) enabled, 3x-ui generates an echConfigList where the public_name field is empty (zero length). According to https://www.rfc-editor.org/rfc/rfc9180 and the
https://www.ietf.org/archive/id/draft-ietf-tls-esni-18.txt:
▎ If the length of the public_name field is 0, the client MUST treat the corresponding ECHConfig as invalid and skip it.
Clients that strictly follow the RFC (such as sing-box via Go's crypto/tls) parse the config list, discard the only entry due to empty public_name, end up with an empty valid-config list, and fail with:
CRYPTO_ERROR 0x150 (local): tls: EncryptedClientHelloConfigList contains no valid configs
How to repeat the problem?
Expected action
The generated echConfigList should contain a non-empty public_name (the outer SNI used in the unencrypted part of the ClientHello, e.g. google.com or the server's own hostname).
Received action
public_name is empty. Binary structure of the generated config (decoded from the ech= URL parameter):
00 53 — ECHConfigList total length: 83
FE 0D — version: 0xFE0D (draft-13 / RFC)
00 4F — ECHConfig content length: 79
00 — config_id
00 20 — KEM ID: DHKEM(X25519, HKDF-SHA256)
00 20 — public key length: 32
FF 37 ... — 32-byte X25519 public key
00 24 — cipher suites length: 36 (9 suites)
... suites ...
00 — maximum_name_length: 0
00 — public_name length: 0 ← BUG: must not be 0
— (no public_name bytes)
00 00 — extensions length: 0
3x-ui Version
3x-ui panel (latest)
Xray-core Version
Xray-core: 26.4.17, Client: sing-box 1.13.11 (built with with_utls, with_quic), Protocol: Hysteria2
Checklist
@antonmarin commented on GitHub (Nov 4, 2026):
Hi! Is it fixed or there is some workaround?