[GH-ISSUE #4967] [Bug]: ECH handshake fails on ports 443 and 8443, but works on high ports (possible DPI interference) #3488

Closed
opened 2026-10-31 20:32:47 +07:00 by bsakaguchi · 1 comment
Owner

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

Describe the bug

After updating to v3.2.8 and configuring ECH, the connection fails when the inbound is set to port 443 or 8443. The client (Xray v1.8.21) sees the ECH config in the link, but the handshake does not complete. However, the same ECH configuration works instantly when the inbound is moved to a high port (e.g., 54433). This is reproducible and strongly suggests DPI interference with the ECH extension on privileged ports.

How to reproduce the problem

Setup: VLESS + TCP + xtls-rprx-vision + TLS (Let's Encrypt certificate) + ECH config.
Set the inbound port to 443 -> Connection fails.
Set the inbound port to 8443 -> Connection fails.
Set the inbound port to 54433 (or any other high port) -> Connection works perfectly.
Expected behavior
ECH handshake should complete successfully on any port, as it's part of the TLS layer and should not be port-dependent.

Possible Solution
Could there be a way to make the ECH ClientHello less "fingerprintable" on these ports, or is this purely a carrier/DPI limitation? It might be useful to document this behavior or provide guidance.

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.2.8

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.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

  • 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 @hvaly1 on GitHub (Jun 5, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4967 ### Describe the bug After updating to v3.2.8 and configuring ECH, the connection fails when the inbound is set to port 443 or 8443. The client (Xray v1.8.21) sees the ECH config in the link, but the handshake does not complete. However, the same ECH configuration works instantly when the inbound is moved to a high port (e.g., 54433). This is reproducible and strongly suggests DPI interference with the ECH extension on privileged ports. ### How to reproduce the problem Setup: VLESS + TCP + xtls-rprx-vision + TLS (Let's Encrypt certificate) + ECH config. Set the inbound port to 443 -> Connection fails. Set the inbound port to 8443 -> Connection fails. Set the inbound port to 54433 (or any other high port) -> Connection works perfectly. Expected behavior ECH handshake should complete successfully on any port, as it's part of the TLS layer and should not be port-dependent. Possible Solution Could there be a way to make the ECH ClientHello less "fingerprintable" on these ports, or is this purely a carrier/DPI limitation? It might be useful to document this behavior or provide guidance. ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.2.8 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.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 - [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:32:47 +07:00
Author
Owner

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

Thanks for the detailed report. After checking the 3x-ui source, I can confirm this is not a bug in the panel — this is DPI interference at the network level. Here is what the code shows and what is most likely happening.

What 3x-ui actually does with ECH

ECH key generation is done by calling xray-core directly:

// web/service/server.go:1660
cmd := exec.Command(xray.GetBinaryPath(), "tls", "ech", "--serverName", sni)

The resulting echConfigList and echServerKeys are stored in the database and embedded into the inbound's TLS streamSettings JSON as-is. There is no port-specific ECH handling anywhere in the 3x-ui codebase — the same config blob goes to xray-core regardless of whether the port is 443, 8443, or 54433.

Why the port matters (DPI interference)

This is a well-known behavior of censorship/DPI infrastructure:

  • Ports 443 and 8443 are the standard HTTPS ports. DPI equipment specifically monitors these ports and can detect the ECH extension type code in the TLS ClientHello (the extension is identifiable even though the SNI it carries is encrypted). Many national firewalls block or reset connections that carry ECH on these ports to prevent circumvention of SNI-based filtering.
  • High ports (e.g. 54433) are not typically inspected at the same depth, so the ECH handshake passes through untouched.

This is the expected — and documented — adversarial behavior against ECH. The panel cannot control what happens on the wire between your client and server.

What you can try

  1. Port 443 alternatives: Use a port that your ISP does not aggressively inspect (anything above ~1024 is usually safer). If port 443 is a hard requirement (e.g., for bypassing restrictive firewalls that only allow 443), ECH alone may not be sufficient against your specific DPI system.
  2. Fragment: Some users combine ECH with TCP fragment (fragment in xray outbound settings) to split the ClientHello across multiple TCP segments, which can defeat some DPI implementations.
  3. Check xray-core logs: If you want to confirm the handshake is being killed externally (TCP RST from the path, connection timeout, etc.) rather than failing locally, run with XUI_LOG_LEVEL=debug and share the xray-core output for the failed 443 attempt.

To help narrow it down further

If you want to investigate whether this is a local config issue vs. external DPI, it would help to see:

  • The xray-core version running on the server side (run x-ui → option for xray version, or xray -version)
  • The xray-core logs (access log + error log) for a failed handshake attempt on port 443

The current panel (v3.2.8) uses xray-core v1.260327.1-0.20260601021109-94ffd50060f1. If the client is on v1.8.21, please verify compatibility with the server-side xray version as well.

<!-- gh-comment-id:4631556655 --> @github-actions[bot] commented on GitHub (Jun 5, 2026): Thanks for the detailed report. After checking the 3x-ui source, I can confirm this is **not a bug in the panel** — this is DPI interference at the network level. Here is what the code shows and what is most likely happening. ## What 3x-ui actually does with ECH ECH key generation is done by calling xray-core directly: ``` // web/service/server.go:1660 cmd := exec.Command(xray.GetBinaryPath(), "tls", "ech", "--serverName", sni) ``` The resulting `echConfigList` and `echServerKeys` are stored in the database and embedded into the inbound's TLS `streamSettings` JSON as-is. There is **no port-specific ECH handling anywhere** in the 3x-ui codebase — the same config blob goes to xray-core regardless of whether the port is 443, 8443, or 54433. ## Why the port matters (DPI interference) This is a well-known behavior of censorship/DPI infrastructure: - **Ports 443 and 8443** are the standard HTTPS ports. DPI equipment specifically monitors these ports and can detect the ECH extension type code in the TLS ClientHello (the extension is identifiable even though the SNI it carries is encrypted). Many national firewalls block or reset connections that carry ECH on these ports to prevent circumvention of SNI-based filtering. - **High ports (e.g. 54433)** are not typically inspected at the same depth, so the ECH handshake passes through untouched. This is the expected — and documented — adversarial behavior against ECH. The panel cannot control what happens on the wire between your client and server. ## What you can try 1. **Port 443 alternatives**: Use a port that your ISP does not aggressively inspect (anything above ~1024 is usually safer). If port 443 is a hard requirement (e.g., for bypassing restrictive firewalls that only allow 443), ECH alone may not be sufficient against your specific DPI system. 2. **Fragment**: Some users combine ECH with TCP fragment (`fragment` in xray outbound settings) to split the ClientHello across multiple TCP segments, which can defeat some DPI implementations. 3. **Check xray-core logs**: If you want to confirm the handshake is being killed externally (TCP RST from the path, connection timeout, etc.) rather than failing locally, run with `XUI_LOG_LEVEL=debug` and share the xray-core output for the failed 443 attempt. ## To help narrow it down further If you want to investigate whether this is a local config issue vs. external DPI, it would help to see: - The xray-core version running on the **server** side (run `x-ui` → option for xray version, or `xray -version`) - The xray-core logs (access log + error log) for a failed handshake attempt on port 443 The current panel (v3.2.8) uses xray-core `v1.260327.1-0.20260601021109-94ffd50060f1`. If the client is on v1.8.21, please verify compatibility with the server-side xray version as well.
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#3488
No description provided.