[GH-ISSUE #6566] [Bug]: Clash subscription update returns no nodes, while direct link import works #4401

Closed
opened 2026-10-31 20:39:24 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @liangyoufeng on GitHub (Sep 16, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6566

Describe the bug

I used and activated the Clash subscription feature, and then used a custom domain name and certificate to access the subscription link. Scanning or copying the link directly to import nodes is normal, but although scanning and copying subscriptions can be added, updating subscriptions does not return nodes.
View the logs as follows:
Sep 16 15:08:08 aio x-ui[253880]: 2026/09/16 15:08:08 http: TLS handshake error from 14.26.160.166:52509: write tcp 172.25.51.36:12096->14.26.160.166:52509: write: connection reset by peer
I don't know where the configuration went wrong, please assist me

How to reproduce the problem

  1. Install 3xui through command
  2. Set the panel settings - subscription formats to enable automatic recognition of clash
  3. Panel Settings - Subscription Settings - Open Clash Subscription, Modify/sub/and 2096 Ports, and Open Routing in Clash/miHomo - Save - Restart Panel
  4. Create a regular inbound and client-side to test usage

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

v3.8.5

Xray-core version

26.9.9

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

  • 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 @liangyoufeng on GitHub (Sep 16, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6566 ### Describe the bug I used and activated the Clash subscription feature, and then used a custom domain name and certificate to access the subscription link. Scanning or copying the link directly to import nodes is normal, but although scanning and copying subscriptions can be added, updating subscriptions does not return nodes. View the logs as follows: Sep 16 15:08:08 aio x-ui[253880]: 2026/09/16 15:08:08 http: TLS handshake error from 14.26.160.166:52509: write tcp 172.25.51.36:12096->14.26.160.166:52509: write: connection reset by peer I don't know where the configuration went wrong, please assist me ### How to reproduce the problem 1. Install 3xui through command 2. Set the panel settings - subscription formats to enable automatic recognition of clash 3. Panel Settings - Subscription Settings - Open Clash Subscription, Modify/sub/and 2096 Ports, and Open Routing in Clash/miHomo - Save - Restart Panel 4. Create a regular inbound and client-side to test usage ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version v3.8.5 ### Xray-core version 26.9.9 ### 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 - [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:39:24 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@github-actions[bot] commented on GitHub (Sep 16, 2026):

Thanks for the report — I could not confirm a defect from what is in it, and the one log line you pasted points at a different failure than "the Clash profile comes back empty". Below is what I verified in the source, the most likely cause, and the two commands that will tell the two failures apart.

What your log line actually says

http: TLS handshake error from 14.26.160.166:52509: write tcp 172.25.51.36:12096->14.26.160.166:52509: write: connection reset by peer

That string is not produced by 3x-ui — it does not exist anywhere in the panel source. It comes from Go's net/http, which the subscription server uses directly (internal/sub/sub.go:401-421), and it is logged when the TLS handshake fails, i.e. before any HTTP request line is read. No subscription handler ran for that connection. A single such line is normally a client or a port scanner closing mid-handshake, and on its own it is not evidence of a subscription bug.

One thing that does not line up: you say you set the subscription port to 2096, but the log line is from 12096 (172.25.51.36:12096). I cannot tell from the report which listener that is. The subscription server is a separate listener from the panel (main.go:125-127, bound to subPort in internal/sub/sub.go:388-392), and the panel port does not serve /sub/ — a subscription URL pointed at the panel port will never return a profile.

What I ruled out in the code

  • Step 3 of your repro ("open routing in Clash/miHomo") cannot empty the profile by itself. subClashRules defaults to "" (internal/web/service/setting.go:157) and the merge is guarded:

    // internal/sub/clash_service.go:161-171
    if s.enableRouting && !legacy {
        resolved, remoteDocument, remote, resolveErr := resolveClashRoutingSource(s.clashRules)
        if resolveErr == nil && strings.TrimSpace(resolved) != "" {
    

    With an empty rules box the toggle is a no-op.

  • Clash auto-detect is User-Agent based, with the default matcher (?i)(clash|mihomo) (internal/web/service/setting.go:38). If your client's UA contains neither word, /sub/<id> falls through to the raw branch and returns the base64 link list (internal/sub/controller.go:470-512; subEncrypt defaults to "true"), which a Clash client imports as zero proxies.

  • Accept: text/html beats auto-detect on purpose. wantsHTML short-circuits shouldAutoServeFormat (internal/sub/controller.go:534-539) and is pinned by a test — {name: "browser HTML wins", autoDetect: true, clashEnabled: true, wantsHTML: true, userAgent: "Clash-Verge/v2.4.2"} (internal/sub/controller_test.go:197). A client that sends that header gets the HTML info page, not YAML.

Most likely cause, if the HTTPS fetch is in fact succeeding

Auto-detect deliberately does not tell Clash for Windows apart from Mihomo — ClashforWindows/0.20.39 matches the same regex and is served the Mihomo profile (internal/sub/controller_test.go:192). The legacy Clash core cannot parse that profile (no vless, Reality, Hysteria2, XHTTP, HTTPUpgrade, SS-2022) and shows no nodes. For that client the endpoint is:

https://<your-domain>:<sub-port>/clash-legacy/<sub-id>

which filters down to the proxy types the legacy core supports, and returns an explicit 422 instead of an unusable profile when nothing is compatible (internal/sub/controller.go:890-892). Clash Verge Rev / Mihomo / FlClash should use /clash/<sub-id> or /mihomo/<sub-id>. This is documented under Subscription → Output formats.

Two checks that settle it

1. Is the subscription server actually on HTTPS?

journalctl -u x-ui --no-pager | grep -iE "Sub server running|Error loading certificates"

It prints either Sub server running HTTPS on … or Sub server running HTTP on … (internal/sub/sub.go:402, :405, :408). If it says HTTP, the certificate did not load and the Error loading certificates: line just above says why (internal/sub/sub.go:404). Note the subscription server has its own cert settings, subCertFile / subKeyFile — separate from the panel's. Setting only the panel certificate leaves the subscription server on plain HTTP.

2. What does the client actually receive?

curl -sv -o /tmp/sub.out -w 'status=%{http_code}\n' \
  -H 'User-Agent: mihomo/1.19.12' \
  'https://YOUR.DOMAIN:2096/sub/YOUR_SUBID'
head -c 300 /tmp/sub.out

How to read it:

Result Meaning
200 + YAML starting with proxies: the panel is fine; the problem is in the client (see the dialect note above)
200 + one long base64 blob auto-detect did not fire for your client's real User-Agent
200 + <!doctype html> your client sends Accept: text/html
404 the sub id matches no client (internal/sub/controller.go:37-43)
403 "Subscription domain" is set and the Host you used does not match (internal/web/middleware/domainValidator.go:24-27)
curl fails before any status a transport/TLS problem, which is what your journal line hints at — not a subscription problem

What I still need

  1. The output of both commands above (redact the domain and the sub id).
  2. The client app and its exact version — Clash for Windows, Clash Verge Rev, mihomo, FlClash, Clash Meta for Android — and the exact error text it shows on update.
  3. The subscription URL shape you gave the client: scheme, port and path, and whether that port is the panel port or the subscription port. Your report says 2096, your log says 12096.
  4. The protocol / transport / security of the test inbound you created (for example VLESS + TCP + Reality).

I cannot run the panel or open images here, so please paste text rather than screenshots.

Verdict: Insufficient information
Severity: N/A
Confidence: Medium
Root cause: None established. The reported symptom has at least three distinct causes that the report cannot distinguish: the HTTPS fetch never completing (what the pasted net/http handshake line shows), the raw base64 body being served because the User-Agent misses (?i)(clash|mihomo) (internal/sub/controller.go:470-512), and a Mihomo-dialect profile served to a legacy Clash for Windows client (internal/sub/controller_test.go:192 + docs/content/docs/en/config/subscription.mdx:72-75).
Already fixed: Not applicable — v3.8.5 is the current release (gh release list), and nothing in this path changed between v3.8.0 and HEAD except e26cf1d3, which touches only subPageContext (internal/sub/controller.go:661-687), not the subscription body.
Duplicate of: None
Evidence: internal/web/service/setting.go:157 "subClashRules": "" and internal/sub/clash_service.go:161-171 (if resolveErr == nil && strings.TrimSpace(resolved) != "") — the Clash routing toggle is a no-op with an empty rules field; internal/web/service/setting.go:38 DefaultSubClashUserAgentRegex = (?i)(clash|mihomo); internal/sub/controller.go:534-539 if !autoDetect || !formatEnabled || wantsHTML || userAgentRegex == nil { return false } with internal/sub/controller_test.go:197 pinning "browser HTML wins"; internal/sub/controller_test.go:192 pinning ClashforWindows/0.20.39 → Mihomo profile; internal/sub/sub.go:394-409 (sub server TLS is driven by subCertFile/subKeyFile only, falling back to plain HTTP with Error loading certificates: on a load failure); main.go:125-127 (subscription server is a separate listener from the panel); no occurrence of the literal TLS handshake error anywhere in the Go source.
Not determined: Whether the Clash client ever gets an HTTP 200 at all. Check 2 above (curl with a mihomo User-Agent against the subscription URL) settles it in one command.

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

<!-- gh-comment-id:5693914185 --> @github-actions[bot] commented on GitHub (Sep 16, 2026): Thanks for the report — I could not confirm a defect from what is in it, and the one log line you pasted points at a **different** failure than "the Clash profile comes back empty". Below is what I verified in the source, the most likely cause, and the two commands that will tell the two failures apart. ## What your log line actually says ``` http: TLS handshake error from 14.26.160.166:52509: write tcp 172.25.51.36:12096->14.26.160.166:52509: write: connection reset by peer ``` That string is **not produced by 3x-ui** — it does not exist anywhere in the panel source. It comes from Go's `net/http`, which the subscription server uses directly (`internal/sub/sub.go:401-421`), and it is logged when the TLS handshake fails, i.e. *before* any HTTP request line is read. No subscription handler ran for that connection. A single such line is normally a client or a port scanner closing mid-handshake, and on its own it is not evidence of a subscription bug. One thing that does not line up: you say you set the subscription port to **2096**, but the log line is from **12096** (`172.25.51.36:12096`). I cannot tell from the report which listener that is. The subscription server is a **separate listener** from the panel (`main.go:125-127`, bound to `subPort` in `internal/sub/sub.go:388-392`), and the panel port does not serve `/sub/` — a subscription URL pointed at the panel port will never return a profile. ## What I ruled out in the code * **Step 3 of your repro ("open routing in Clash/miHomo") cannot empty the profile by itself.** `subClashRules` defaults to `""` (`internal/web/service/setting.go:157`) and the merge is guarded: ```go // internal/sub/clash_service.go:161-171 if s.enableRouting && !legacy { resolved, remoteDocument, remote, resolveErr := resolveClashRoutingSource(s.clashRules) if resolveErr == nil && strings.TrimSpace(resolved) != "" { ``` With an empty rules box the toggle is a no-op. * **Clash auto-detect is User-Agent based**, with the default matcher `(?i)(clash|mihomo)` (`internal/web/service/setting.go:38`). If your client's UA contains neither word, `/sub/<id>` falls through to the raw branch and returns the **base64 link list** (`internal/sub/controller.go:470-512`; `subEncrypt` defaults to `"true"`), which a Clash client imports as zero proxies. * **`Accept: text/html` beats auto-detect on purpose.** `wantsHTML` short-circuits `shouldAutoServeFormat` (`internal/sub/controller.go:534-539`) and is pinned by a test — `{name: "browser HTML wins", autoDetect: true, clashEnabled: true, wantsHTML: true, userAgent: "Clash-Verge/v2.4.2"}` (`internal/sub/controller_test.go:197`). A client that sends that header gets the HTML info page, not YAML. ## Most likely cause, if the HTTPS fetch is in fact succeeding Auto-detect deliberately does **not** tell Clash for Windows apart from Mihomo — `ClashforWindows/0.20.39` matches the same regex and is served the **Mihomo** profile (`internal/sub/controller_test.go:192`). The legacy Clash core cannot parse that profile (no `vless`, Reality, Hysteria2, XHTTP, HTTPUpgrade, SS-2022) and shows no nodes. For that client the endpoint is: ```text https://<your-domain>:<sub-port>/clash-legacy/<sub-id> ``` which filters down to the proxy types the legacy core supports, and returns an explicit `422` instead of an unusable profile when nothing is compatible (`internal/sub/controller.go:890-892`). Clash Verge Rev / Mihomo / FlClash should use `/clash/<sub-id>` or `/mihomo/<sub-id>`. This is documented under [Subscription → Output formats](https://docs.sanaei.dev/docs/config/subscription). ## Two checks that settle it **1. Is the subscription server actually on HTTPS?** ```bash journalctl -u x-ui --no-pager | grep -iE "Sub server running|Error loading certificates" ``` It prints either `Sub server running HTTPS on …` or `Sub server running HTTP on …` (`internal/sub/sub.go:402`, `:405`, `:408`). If it says HTTP, the certificate did not load and the `Error loading certificates:` line just above says why (`internal/sub/sub.go:404`). Note the subscription server has its **own** cert settings, `subCertFile` / `subKeyFile` — separate from the panel's. Setting only the panel certificate leaves the subscription server on plain HTTP. **2. What does the client actually receive?** ```bash curl -sv -o /tmp/sub.out -w 'status=%{http_code}\n' \ -H 'User-Agent: mihomo/1.19.12' \ 'https://YOUR.DOMAIN:2096/sub/YOUR_SUBID' head -c 300 /tmp/sub.out ``` How to read it: | Result | Meaning | | --- | --- | | `200` + YAML starting with `proxies:` | the panel is fine; the problem is in the client (see the dialect note above) | | `200` + one long base64 blob | auto-detect did not fire for your client's real User-Agent | | `200` + `<!doctype html>` | your client sends `Accept: text/html` | | `404` | the sub id matches no client (`internal/sub/controller.go:37-43`) | | `403` | "Subscription domain" is set and the Host you used does not match (`internal/web/middleware/domainValidator.go:24-27`) | | curl fails before any status | a transport/TLS problem, which is what your journal line hints at — not a subscription problem | ## What I still need 1. The output of both commands above (redact the domain and the sub id). 2. The client app and its exact version — Clash for Windows, Clash Verge Rev, mihomo, FlClash, Clash Meta for Android — and the exact error text it shows on update. 3. The subscription URL shape you gave the client: scheme, port and path, and whether that port is the panel port or the subscription port. Your report says 2096, your log says 12096. 4. The protocol / transport / security of the test inbound you created (for example VLESS + TCP + Reality). I cannot run the panel or open images here, so please paste text rather than screenshots. Verdict: Insufficient information Severity: N/A Confidence: Medium Root cause: None established. The reported symptom has at least three distinct causes that the report cannot distinguish: the HTTPS fetch never completing (what the pasted `net/http` handshake line shows), the raw base64 body being served because the User-Agent misses `(?i)(clash|mihomo)` (`internal/sub/controller.go:470-512`), and a Mihomo-dialect profile served to a legacy Clash for Windows client (`internal/sub/controller_test.go:192` + `docs/content/docs/en/config/subscription.mdx:72-75`). Already fixed: Not applicable — v3.8.5 is the current release (`gh release list`), and nothing in this path changed between v3.8.0 and HEAD except `e26cf1d3`, which touches only `subPageContext` (`internal/sub/controller.go:661-687`), not the subscription body. Duplicate of: None Evidence: `internal/web/service/setting.go:157` `"subClashRules": ""` and `internal/sub/clash_service.go:161-171` (`if resolveErr == nil && strings.TrimSpace(resolved) != ""`) — the Clash routing toggle is a no-op with an empty rules field; `internal/web/service/setting.go:38` DefaultSubClashUserAgentRegex = (?i)(clash|mihomo); `internal/sub/controller.go:534-539` `if !autoDetect || !formatEnabled || wantsHTML || userAgentRegex == nil { return false }` with `internal/sub/controller_test.go:197` pinning "browser HTML wins"; `internal/sub/controller_test.go:192` pinning `ClashforWindows/0.20.39` → Mihomo profile; `internal/sub/sub.go:394-409` (sub server TLS is driven by `subCertFile`/`subKeyFile` only, falling back to plain HTTP with `Error loading certificates:` on a load failure); `main.go:125-127` (subscription server is a separate listener from the panel); no occurrence of the literal `TLS handshake error` anywhere in the Go source. Not determined: Whether the Clash client ever gets an HTTP 200 at all. Check 2 above (`curl` with a mihomo User-Agent against the subscription URL) settles it in one command. *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
Author
Owner

@liangyoufeng commented on GitHub (Sep 16, 2026):

root@aio:~# journalctl -u x-ui --no-pager | grep -iE "Sub server running|Error loading certificates"
Sep 16 14:59:24 aio /usr/local/x-ui/x-ui[253880]: INFO - Sub server running HTTPS on [::]:12096

root@aio:~# curl -vk https://127.0.0.1:12096/xxx/xxx 2>&1 | head -30

  • Uses proxy env variable no_proxy == 'localhost,127.0.0.1,::1'
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 127.0.0.1:12096...
  • Connected to 127.0.0.1 (127.0.0.1) port 12096
  • ALPN: curl offers h2,http/1.1
    } [5 bytes data]
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
    } [512 bytes data]
  • TLSv1.3 (IN), TLS handshake, Server hello (2):
    { [122 bytes data]
  • TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
    { [6 bytes data]
  • TLSv1.3 (IN), TLS handshake, Certificate (11):
    { [3420 bytes data]
  • TLSv1.3 (IN), TLS handshake, CERT verify (15):
    { [79 bytes data]
  • TLSv1.3 (IN), TLS handshake, Finished (20):
    { [36 bytes data]
  • TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
    } [1 bytes data]
  • TLSv1.3 (OUT), TLS handshake, Finished (20):
    } [36 bytes data]
  • SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256 / X25519 / id-ecPublicKey
  • ALPN: server did not agree on a protocol. Uses default.
  • Server certificate:
  • subject: CN=xxx.net
  • start date: Sep 13 04:27:34 2026 GMT
  • expire date: Dec 12 04:27:33 2026 GMT
  • issuer: C=US; O=Let's Encrypt; CN=YE1
<!-- gh-comment-id:5694524871 --> @liangyoufeng commented on GitHub (Sep 16, 2026): root@aio:~# journalctl -u x-ui --no-pager | grep -iE "Sub server running|Error loading certificates" Sep 16 14:59:24 aio /usr/local/x-ui/x-ui[253880]: INFO - Sub server running HTTPS on [::]:12096 root@aio:~# curl -vk https://127.0.0.1:12096/xxx/xxx 2>&1 | head -30 * Uses proxy env variable no_proxy == 'localhost,127.0.0.1,::1' % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 127.0.0.1:12096... * Connected to 127.0.0.1 (127.0.0.1) port 12096 * ALPN: curl offers h2,http/1.1 } [5 bytes data] * TLSv1.3 (OUT), TLS handshake, Client hello (1): } [512 bytes data] * TLSv1.3 (IN), TLS handshake, Server hello (2): { [122 bytes data] * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8): { [6 bytes data] * TLSv1.3 (IN), TLS handshake, Certificate (11): { [3420 bytes data] * TLSv1.3 (IN), TLS handshake, CERT verify (15): { [79 bytes data] * TLSv1.3 (IN), TLS handshake, Finished (20): { [36 bytes data] * TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1): } [1 bytes data] * TLSv1.3 (OUT), TLS handshake, Finished (20): } [36 bytes data] * SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256 / X25519 / id-ecPublicKey * ALPN: server did not agree on a protocol. Uses default. * Server certificate: * subject: CN=xxx.net * start date: Sep 13 04:27:34 2026 GMT * expire date: Dec 12 04:27:33 2026 GMT * issuer: C=US; O=Let's Encrypt; CN=YE1
Author
Owner

@liangyoufeng commented on GitHub (Sep 16, 2026):

root@aio:~# curl -sv -o /tmp/sub.out -w 'status=%{http_code}\n'
-H 'User-Agent: mihomo/1.19.12'
'https://xxx.net:12096/xxx/xxx'
head -c 300 /tmp/sub.out

  • Host xxx.net:12096 was resolved.
  • IPv6: (none)
  • IPv4: xxx
  • Trying xxx:12096...
  • Connected to xxx.net (xxx) port 12096
  • ALPN: curl offers h2,http/1.1
    } [5 bytes data]
  • TLSv1.3 (OUT), TLS handshake, Client hello (1):
    } [512 bytes data]
  • CAfile: /etc/ssl/certs/ca-certificates.crt
  • CApath: /etc/ssl/certs
    { [5 bytes data]
  • TLSv1.3 (IN), TLS handshake, Server hello (2):
    { [122 bytes data]
  • TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
    { [10 bytes data]
  • TLSv1.3 (IN), TLS handshake, Certificate (11):
    { [3420 bytes data]
  • TLSv1.3 (IN), TLS handshake, CERT verify (15):
    { [80 bytes data]
  • TLSv1.3 (IN), TLS handshake, Finished (20):
    { [36 bytes data]
  • TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
    } [1 bytes data]
  • TLSv1.3 (OUT), TLS handshake, Finished (20):
    } [36 bytes data]
  • SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256 / X25519 / id-ecPublicKey
  • ALPN: server did not agree on a protocol. Uses default.
  • Server certificate:
  • subject: CN=xxx.net
  • start date: Sep 13 04:27:34 2026 GMT
  • expire date: Dec 12 04:27:33 2026 GMT
  • subjectAltName: host "xxx.net" matched cert's "xxx.net"
  • issuer: C=US; O=Let's Encrypt; CN=YE1
  • SSL certificate verify ok.
  • Certificate level 0: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using ecdsa-with-SHA384
  • Certificate level 1: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384
  • Certificate level 2: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384
  • Certificate level 3: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384
  • using HTTP/1.x
    } [5 bytes data]

GET /fuck/jzzumq2ccutyi6pp HTTP/1.1
Host: xxx.net:12096
Accept: /
User-Agent: mihomo/1.19.12

{ [5 bytes data]

  • TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
    { [122 bytes data]
    < HTTP/1.1 200 OK
    < Content-Length: 465
    < Content-Type: application/yaml; charset=utf-8
    < Profile-Update-Interval: 12
    < Subscription-Userinfo: upload=10230; download=47621; total=0; expire=0
    < Date: Wed, 16 Sep 2026 08:36:03 GMT
    <
    { [465 bytes data]
  • Connection #0 to host xxx.net left intact
    status=200
    proxies:
  • client-fingerprint: chrome
    name: vless-test
    network: tcp
    port: 16509
    reality-opts:
    public-key: xxxxUozA
    short-id: xxx012
    support-x25519mlkem768: true
    server: xxx.net
    servername: aws.amazon.com
    tls: true
<!-- gh-comment-id:5694582105 --> @liangyoufeng commented on GitHub (Sep 16, 2026): root@aio:~# curl -sv -o /tmp/sub.out -w 'status=%{http_code}\n' \ -H 'User-Agent: mihomo/1.19.12' \ 'https://xxx.net:12096/xxx/xxx' head -c 300 /tmp/sub.out * Host xxx.net:12096 was resolved. * IPv6: (none) * IPv4: xxx * Trying xxx:12096... * Connected to xxx.net (xxx) port 12096 * ALPN: curl offers h2,http/1.1 } [5 bytes data] * TLSv1.3 (OUT), TLS handshake, Client hello (1): } [512 bytes data] * CAfile: /etc/ssl/certs/ca-certificates.crt * CApath: /etc/ssl/certs { [5 bytes data] * TLSv1.3 (IN), TLS handshake, Server hello (2): { [122 bytes data] * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8): { [10 bytes data] * TLSv1.3 (IN), TLS handshake, Certificate (11): { [3420 bytes data] * TLSv1.3 (IN), TLS handshake, CERT verify (15): { [80 bytes data] * TLSv1.3 (IN), TLS handshake, Finished (20): { [36 bytes data] * TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1): } [1 bytes data] * TLSv1.3 (OUT), TLS handshake, Finished (20): } [36 bytes data] * SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256 / X25519 / id-ecPublicKey * ALPN: server did not agree on a protocol. Uses default. * Server certificate: * subject: CN=xxx.net * start date: Sep 13 04:27:34 2026 GMT * expire date: Dec 12 04:27:33 2026 GMT * subjectAltName: host "xxx.net" matched cert's "xxx.net" * issuer: C=US; O=Let's Encrypt; CN=YE1 * SSL certificate verify ok. * Certificate level 0: Public key type EC/prime256v1 (256/128 Bits/secBits), signed using ecdsa-with-SHA384 * Certificate level 1: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384 * Certificate level 2: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384 * Certificate level 3: Public key type EC/secp384r1 (384/192 Bits/secBits), signed using ecdsa-with-SHA384 * using HTTP/1.x } [5 bytes data] > GET /fuck/jzzumq2ccutyi6pp HTTP/1.1 > Host: xxx.net:12096 > Accept: */* > User-Agent: mihomo/1.19.12 > { [5 bytes data] * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4): { [122 bytes data] < HTTP/1.1 200 OK < Content-Length: 465 < Content-Type: application/yaml; charset=utf-8 < Profile-Update-Interval: 12 < Subscription-Userinfo: upload=10230; download=47621; total=0; expire=0 < Date: Wed, 16 Sep 2026 08:36:03 GMT < { [465 bytes data] * Connection #0 to host xxx.net left intact status=200 proxies: - client-fingerprint: chrome name: vless-test network: tcp port: 16509 reality-opts: public-key: xxxxUozA short-id: xxx012 support-x25519mlkem768: true server: xxx.net servername: aws.amazon.com tls: true
Author
Owner

@github-actions[bot] commented on GitHub (Sep 16, 2026):

Thanks — those two outputs clear the panel side. The subscription server is up on HTTPS, the certificate loaded, and it completes a full TLS 1.3 handshake. So the remaining question is no longer "is the panel misconfigured" but "does your client's request ever reach it, and what does it get back" — and there is one log switch that answers both in a single line.

What your output proves

  • INFO - Sub server running HTTPS on [::]:12096 is only printed on the branch where tls.LoadX509KeyPair succeeded (internal/sub/sub.go:394-402); the failure branch prints Error loading certificates: + running HTTP. Your certificate is fine.
  • Incidentally, this confirms my earlier reading of your first log line. 3x-ui's own logger formats every line as %{level} - %{message} (internal/logger/logger.go:133-138) — that is the INFO - prefix above. Your http: TLS handshake error … line has no level prefix, because it comes from Go's net/http, not from panel code.
  • ALPN: server did not agree on a protocol. Uses default. is expected and harmless: the TLS config sets only Certificates and no NextProtos (internal/sub/sub.go:397-399), so no ALPN is negotiated and the server speaks HTTP/1.1. Every HTTP client falls back to that.

What it does not prove (two gaps in that curl)

  1. head -30 cut the output before the HTTP status line, so we still do not know what the server answered.

  2. https://127.0.0.1:12096/... sends Host: 127.0.0.1. If you have Subscription domain set in the panel, that request is rejected before any handler runs:

    // internal/web/middleware/domainValidator.go:24-27
    if host != domain {
        c.AbortWithStatus(http.StatusForbidden)
        return
    }
    

    So a 403 from that command would mean nothing is wrong. Use --resolve (curl -sk --resolve YOUR.DOMAIN:12096:127.0.0.1 -o /tmp/s.out -w '%{http_code}\n' https://YOUR.DOMAIN:12096/PATH/SUBID) if you repeat it.

Also note the port: your report says 2096, the server says 12096. The URL your clients hold must carry the port the server actually listens on.

There is no subscription-specific TLS path

internal/sub/sub.go:394-402 and internal/web/web.go:620-637 build the listener identically — same tls.Config{Certificates: []tls.Certificate{cert}}, same network.NewAutoHttpsListener, same tls.NewListener. If the panel is reachable over HTTPS from the outside and the subscription port is not, the difference is the network path or the port, not panel code.

The one check that settles it

Every request to the <subPath>/<subid> endpoint logs which format branch served it and the client's real User-Agent:

// internal/sub/controller.go:541-542
logger.Debugf("Subscription request routed: branch=%s user_agent=%q", branch, sanitizeUserAgentForLog(userAgent))

The branch is one of info / html / clash / json / raw (internal/sub/controller.go:456-480). It is a DEBUG line, so:

  1. Add XUI_LOG_LEVEL=debug to /etc/default/x-ui — that is the file the unit reads on Ubuntu (x-ui.service.debian:9, EnvironmentFile=-/etc/default/x-ui). Write it exactly lowercase debug: any other value hits log.Fatalf("Unknown log level: %v", …) (main.go:89) and the service will not start.
  2. systemctl restart x-ui
  3. Press "update" in your client, then:
journalctl -u x-ui --since "-2 min" --no-pager | grep -i "Subscription request routed"

How to read the result:

Log line What it means
nothing at all the request never arrived — the failure is on the path between the client and :12096, which is what your TLS handshake error line shows. Not a panel problem.
branch=clash the client received the Mihomo YAML. If it still shows no nodes, the client cannot parse that dialect — legacy Clash for Windows needs /clash-legacy/<subid>, which returns an explicit 422 rather than an unusable profile (internal/sub/controller.go:889-892).
branch=raw auto-detect did not fire, so the client got the base64 link list. The matcher is `(?i)(clash
branch=html your client sends Accept: text/html, which short-circuits auto-detect on purpose (internal/sub/controller.go:534-539). Use the explicit /clash/<subid> URL.

Set the value back to info (or remove the line) once you are done.

Note the log line is emitted for the <subPath>/<subid> endpoint; if you point the client at the explicit /clash/<subid> URL there is no branch line, so run the test with the plain subscription URL first.

One inference, not a source fact: the server writes ServerHello plus a 3420-byte certificate chain, your peer sent RST in the middle of that write, and your server's local address 172.25.51.36 is private — so the box sits behind NAT. TCP clearly reaches the port (the handshake started), so the forward is fine; something on the path, or the client app's own abort, kills it mid-flight. Since your nodes work, it is worth telling the client to fetch the subscription through the proxy and seeing whether the update then succeeds.

What I still need

  1. The Subscription request routed: line(s) from the debug log above — please leave the user_agent= value intact, it is the deciding field.
  2. The client app and its exact version (Clash for Windows, Clash Verge Rev, mihomo, FlClash, Clash Meta for Android).
  3. Only if the log says branch=clash and the client still shows nothing: the protocol / transport / security of the test inbound (for example VLESS + TCP + Reality).

Verdict: Insufficient information
Severity: N/A
Confidence: Medium
Root cause: Still not established, but the panel side is now ruled out by your own output: the HTTPS branch of internal/sub/sub.go:394-402 is the one that ran, and the handshake completes locally with a valid certificate. The two surviving candidates are (a) the client's request never completing over the network — the peer RST in http: TLS handshake error, a string that exists nowhere in this repo — and (b) the client receiving a body it cannot use (raw/html branch, internal/sub/controller.go:456-480).
Already fixed: Not applicable — nothing in this path has changed since v3.8.5; internal/sub/sub.go was last touched by 1d85ef13 (profile page URL disclosure), which does not affect the listener.
Duplicate of: None
Evidence: internal/sub/sub.go:394-402 (HTTPS log line only on a successful tls.LoadX509KeyPair; tls.Config sets Certificates only, hence no ALPN); internal/web/web.go:620-637 (byte-for-byte the same listener construction as the subscription server, so there is no sub-specific TLS path); internal/logger/logger.go:133-138 format = '%{level} - %{message}' (proves the handshake line is stdlib net/http, not panel code); internal/web/middleware/domainValidator.go:24-27 if host != domain { c.AbortWithStatus(http.StatusForbidden) } (a 127.0.0.1 Host is rejected when Subscription domain is set); internal/sub/controller.go:541-542 logger.Debugf("Subscription request routed: branch=%s user_agent=%q", …) with the five call sites at :460, :464, :472, :477, :480; internal/web/service/setting.go:38 DefaultSubClashUserAgentRegex = '(?i)(clash|mihomo)'; internal/sub/controller.go:889-892 (errNoLegacyClashProxies → http.StatusUnprocessableEntity); main.go:77-89 (config.GetLogLevel() drives logger.InitLogger, default: is log.Fatalf); x-ui.service.debian:9 EnvironmentFile=-/etc/default/x-ui.
Not determined: Whether the client's subscription request reaches the panel at all. The XUI_LOG_LEVEL=debug + Subscription request routed check above settles it with one line — its presence or absence splits the two remaining candidates cleanly.

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

<!-- gh-comment-id:5694608048 --> @github-actions[bot] commented on GitHub (Sep 16, 2026): Thanks — those two outputs **clear the panel side**. The subscription server is up on HTTPS, the certificate loaded, and it completes a full TLS 1.3 handshake. So the remaining question is no longer "is the panel misconfigured" but "does your client's request ever reach it, and what does it get back" — and there is one log switch that answers both in a single line. ## What your output proves * `INFO - Sub server running HTTPS on [::]:12096` is only printed on the branch where `tls.LoadX509KeyPair` **succeeded** (`internal/sub/sub.go:394-402`); the failure branch prints `Error loading certificates:` + `running HTTP`. Your certificate is fine. * Incidentally, this confirms my earlier reading of your first log line. 3x-ui's own logger formats every line as `%{level} - %{message}` (`internal/logger/logger.go:133-138`) — that is the `INFO - ` prefix above. Your `http: TLS handshake error …` line has **no** level prefix, because it comes from Go's `net/http`, not from panel code. * `ALPN: server did not agree on a protocol. Uses default.` is expected and harmless: the TLS config sets only `Certificates` and no `NextProtos` (`internal/sub/sub.go:397-399`), so no ALPN is negotiated and the server speaks HTTP/1.1. Every HTTP client falls back to that. ## What it does not prove (two gaps in that curl) 1. `head -30` cut the output **before** the HTTP status line, so we still do not know what the server answered. 2. `https://127.0.0.1:12096/...` sends `Host: 127.0.0.1`. If you have **Subscription domain** set in the panel, that request is rejected before any handler runs: ```go // internal/web/middleware/domainValidator.go:24-27 if host != domain { c.AbortWithStatus(http.StatusForbidden) return } ``` So a 403 from that command would mean nothing is wrong. Use `--resolve` (`curl -sk --resolve YOUR.DOMAIN:12096:127.0.0.1 -o /tmp/s.out -w '%{http_code}\n' https://YOUR.DOMAIN:12096/PATH/SUBID`) if you repeat it. Also note the port: your report says **2096**, the server says **12096**. The URL your clients hold must carry the port the server actually listens on. ## There is no subscription-specific TLS path `internal/sub/sub.go:394-402` and `internal/web/web.go:620-637` build the listener identically — same `tls.Config{Certificates: []tls.Certificate{cert}}`, same `network.NewAutoHttpsListener`, same `tls.NewListener`. If the panel is reachable over HTTPS from the outside and the subscription port is not, the difference is the network path or the port, not panel code. ## The one check that settles it Every request to the `<subPath>/<subid>` endpoint logs which format branch served it and the client's real User-Agent: ```go // internal/sub/controller.go:541-542 logger.Debugf("Subscription request routed: branch=%s user_agent=%q", branch, sanitizeUserAgentForLog(userAgent)) ``` The branch is one of `info` / `html` / `clash` / `json` / `raw` (`internal/sub/controller.go:456-480`). It is a DEBUG line, so: 1. Add `XUI_LOG_LEVEL=debug` to `/etc/default/x-ui` — that is the file the unit reads on Ubuntu (`x-ui.service.debian:9`, `EnvironmentFile=-/etc/default/x-ui`). Write it **exactly lowercase `debug`**: any other value hits `log.Fatalf("Unknown log level: %v", …)` (`main.go:89`) and the service will not start. 2. `systemctl restart x-ui` 3. Press "update" in your client, then: ```bash journalctl -u x-ui --since "-2 min" --no-pager | grep -i "Subscription request routed" ``` How to read the result: | Log line | What it means | | --- | --- | | *nothing at all* | the request never arrived — the failure is on the path between the client and `:12096`, which is what your `TLS handshake error` line shows. Not a panel problem. | | `branch=clash` | the client received the Mihomo YAML. If it still shows no nodes, the client cannot parse that dialect — legacy Clash for Windows needs `/clash-legacy/<subid>`, which returns an explicit `422` rather than an unusable profile (`internal/sub/controller.go:889-892`). | | `branch=raw` | auto-detect did not fire, so the client got the base64 link list. The matcher is `(?i)(clash|mihomo)` (`internal/web/service/setting.go:38`) — send me the `user_agent=` value from the log and widen that regex in the subscription settings. | | `branch=html` | your client sends `Accept: text/html`, which short-circuits auto-detect on purpose (`internal/sub/controller.go:534-539`). Use the explicit `/clash/<subid>` URL. | Set the value back to `info` (or remove the line) once you are done. Note the log line is emitted for the `<subPath>/<subid>` endpoint; if you point the client at the explicit `/clash/<subid>` URL there is no branch line, so run the test with the plain subscription URL first. One inference, not a source fact: the server writes ServerHello plus a 3420-byte certificate chain, your peer sent RST in the middle of that write, and your server's local address `172.25.51.36` is private — so the box sits behind NAT. TCP clearly reaches the port (the handshake started), so the forward is fine; something on the path, or the client app's own abort, kills it mid-flight. Since your nodes work, it is worth telling the client to fetch the subscription **through the proxy** and seeing whether the update then succeeds. ## What I still need 1. The `Subscription request routed:` line(s) from the debug log above — please leave the `user_agent=` value intact, it is the deciding field. 2. The client app and its exact version (Clash for Windows, Clash Verge Rev, mihomo, FlClash, Clash Meta for Android). 3. Only if the log says `branch=clash` and the client still shows nothing: the protocol / transport / security of the test inbound (for example VLESS + TCP + Reality). Verdict: Insufficient information Severity: N/A Confidence: Medium Root cause: Still not established, but the panel side is now ruled out by your own output: the HTTPS branch of `internal/sub/sub.go:394-402` is the one that ran, and the handshake completes locally with a valid certificate. The two surviving candidates are (a) the client's request never completing over the network — the peer RST in `http: TLS handshake error`, a string that exists nowhere in this repo — and (b) the client receiving a body it cannot use (`raw`/`html` branch, `internal/sub/controller.go:456-480`). Already fixed: Not applicable — nothing in this path has changed since v3.8.5; `internal/sub/sub.go` was last touched by `1d85ef13` (profile page URL disclosure), which does not affect the listener. Duplicate of: None Evidence: `internal/sub/sub.go:394-402` (HTTPS log line only on a successful `tls.LoadX509KeyPair`; `tls.Config` sets `Certificates` only, hence no ALPN); `internal/web/web.go:620-637` (byte-for-byte the same listener construction as the subscription server, so there is no sub-specific TLS path); `internal/logger/logger.go:133-138` `format = '%{level} - %{message}'` (proves the handshake line is stdlib `net/http`, not panel code); `internal/web/middleware/domainValidator.go:24-27` `if host != domain { c.AbortWithStatus(http.StatusForbidden) }` (a `127.0.0.1` Host is rejected when Subscription domain is set); `internal/sub/controller.go:541-542` `logger.Debugf("Subscription request routed: branch=%s user_agent=%q", …)` with the five call sites at `:460`, `:464`, `:472`, `:477`, `:480`; `internal/web/service/setting.go:38` `DefaultSubClashUserAgentRegex = '(?i)(clash|mihomo)'`; `internal/sub/controller.go:889-892` (`errNoLegacyClashProxies` → `http.StatusUnprocessableEntity`); `main.go:77-89` (`config.GetLogLevel()` drives `logger.InitLogger`, `default:` is `log.Fatalf`); `x-ui.service.debian:9` `EnvironmentFile=-/etc/default/x-ui`. Not determined: Whether the client's subscription request reaches the panel at all. The `XUI_LOG_LEVEL=debug` + `Subscription request routed` check above settles it with one line — its presence or absence splits the two remaining candidates cleanly. *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
Author
Owner

@github-actions[bot] commented on GitHub (Sep 16, 2026):

Your own output settles it: the panel is serving the Clash subscription correctly. The request returned 200, Content-Type: application/yaml, and a real Mihomo profile containing your vless-test node. There is no defect on the panel side — the failure is between your client and port 12096, or inside the client app.

What your paste proves

< HTTP/1.1 200 OK
< Content-Type: application/yaml; charset=utf-8
< Subscription-Userinfo: upload=10230; download=47621; total=0; expire=0
status=200
proxies:
- client-fingerprint: chrome
  name: vless-test
  ...
  1. Auto-detect fired and the Clash branch served the response. application/yaml; charset=utf-8 is set only on the Clash branch (internal/sub/controller.go:914), so your mihomo/1.19.12 User-Agent matched (?i)(clash|mihomo) (internal/web/service/setting.go:38) and the server did not fall through to the raw base64 or HTML branch.

  2. The profile you received is complete, not truncated-empty. Your head -c 300 cut the body at 300 of 465 bytes, but the generator is unconditional — every Clash response is built from this map:

    // internal/sub/clash_service.go:149-157
    config := map[string]any{
        "proxies": proxies,
        "proxy-groups": []map[string]any{{
            "name":    "PROXY",
            "type":    "select",
            "proxies": proxyNames,
        }},
        "rules": []string{"MATCH,PROXY"},
    }
    

    Keys are emitted alphabetically — visible in your own output, where the node's keys run client-fingerprint, name, network, port, reality-opts, server, servername, tls — so proxy-groups: and rules: sort after the proxies: block and sit in the 165 bytes your head -c 300 discarded. An empty profile is impossible on this path anyway: getClash returns an empty string when there is nothing to serve (internal/sub/clash_service.go:99-101, 132-134), the handler then takes return false at controller.go:897-899, and writeSubError(c, nil) sets c.Status(http.StatusNotFound) (internal/sub/controller.go:37-41). You would have gotten a 404, not a 200.

  3. Subscription-Userinfo: upload=10230; download=47621 shows the node itself has carried traffic. That matches your report that direct link import works.

So what is failing

The only failure signal anywhere in this thread is still the line from your first post:

http: TLS handshake error from 14.26.160.166:52509: write tcp 172.25.51.36:12096->14.26.160.166:52509: write: connection reset by peer

That string does not exist anywhere in this repository — it is Go's net/http, logged when the TLS handshake dies before any request line is read. Your curl ran on the server itself (root@aio:~#), so it exercised the loopback/hairpin path, not the path from 14.26.160.166. The two are not the same test.

Why one works and the other does not, stated as an inference rather than a source fact: your nodes are REALITY on port 16509 masquerading as aws.amazon.com, which is designed to survive exactly this. Your subscription fetch is ordinary TLS to your own domain on a non-standard port 12096, presenting a 4-level Let's Encrypt chain that your own trace shows is 3420 bytes. Your server's local address 172.25.51.36 is private, so the box sits behind NAT. A peer RST arriving while the server is writing that large certificate flight is the signature of either path interference or a PMTU black hole — not of panel code. internal/sub/sub.go:394-402 and internal/web/web.go:620-637 build the two listeners identically, so there is no subscription-specific TLS behaviour to blame.

What to do

  1. Run the same curl from the client's device, not from the server. That is the test that has not been done yet. If it fails there and succeeds on the server, the panel is out of the picture.
  2. Have the client fetch the subscription through the proxy. Mihomo, Clash Verge Rev and FlClash all have an option to route profile updates through the active node. Since your nodes work, this is the fastest workaround.
  3. Move the subscription behind 443 / a CDN. Set the subscription port to 443, or front it with a reverse proxy and set Subscription URL (subURI) so the links the panel hands out point at the public address — see Panel settings and Subscription.
  4. If the client does receive the profile and still shows nothing, the remaining candidate is the REALITY + Mihomo ML-KEM interaction: your profile sets reality-opts.support-x25519mlkem768: true (internal/sub/clash_service.go:1135), and the constraints around it are written up at REALITY → Mihomo and ML-KEM.

Two housekeeping notes. Your report said port 2096; the server and both traces say 12096 — the URL your clients hold must carry 12096. And the > GET /… request line in your last paste was not redacted, so your real subscription path and subscription ID are now public in this thread; rotate the client's subscription ID and change the subscription path in the panel.

I am closing this as a configuration/network issue rather than a panel defect. If you run the XUI_LOG_LEVEL=debug check from my previous comment and the Subscription request routed: branch=… line shows branch=raw or branch=html for your real client, comment here with that line and it can be looked at again — that would be the one outcome that points back at the panel.

Verdict: Not a bug (user configuration)
Severity: N/A
Confidence: High that there is no panel-side defect (proven by the reporter's own 200 response plus the source below); the network-path diagnosis is explicitly labelled an inference.
Root cause: None in 3x-ui. The subscription server returns a complete, valid Mihomo profile for this subscription ID — confirmed end to end by the reporter's own curl (status=200, application/yaml; charset=utf-8, body beginning proxies:). The remaining failure is the TLS handshake being reset by the peer before any request line is read, which happens in Go's net/http below all panel code.
Already fixed: Not applicable — v3.8.5 is the current release (gh release list), and no defect was found to fix.
Duplicate of: None — gh search issues --repo MHSanaei/3x-ui "clash subscription no nodes", "subscription update no nodes" and "TLS handshake error subscription" all returned no candidates.
Evidence: internal/sub/controller.go:914 c.Data(200, "application/yaml; charset=utf-8", []byte(clashSub)) — that content type is emitted only by the Clash branch, so auto-detect fired for the reporter's UA; internal/sub/clash_service.go:149-157 (proxies + proxy-groups + rules built unconditionally, so a 200 on this path is never an empty profile) with internal/sub/clash_service.go:99-101 and :132-134 returning an empty body — hence a 404 — when there is nothing to serve; internal/web/service/setting.go:38 DefaultSubClashUserAgentRegex = '(?i)(clash|mihomo)'; internal/sub/sub.go:394-402 vs internal/web/web.go:620-637 (identical listener construction, no sub-specific TLS path); internal/sub/clash_service.go:1135 realityOpts["support-x25519mlkem768"] = true with docs/content/docs/en/config/reality.mdx:126-135; no occurrence of the literal TLS handshake error anywhere in the Go source, confirming that line is stdlib net/http.
Not determined: Whether the remote client's request reaches :12096 at all. The reporter's curl ran on the server itself, so it does not test the external path; repeating it from the client's own device settles it in one command.

I also made the title more specific — it was "[Bug]: Subscription cannot be used", which did not say which part failed.

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

<!-- gh-comment-id:5694691879 --> @github-actions[bot] commented on GitHub (Sep 16, 2026): Your own output settles it: **the panel is serving the Clash subscription correctly.** The request returned `200`, `Content-Type: application/yaml`, and a real Mihomo profile containing your `vless-test` node. There is no defect on the panel side — the failure is between your client and port `12096`, or inside the client app. ## What your paste proves ``` < HTTP/1.1 200 OK < Content-Type: application/yaml; charset=utf-8 < Subscription-Userinfo: upload=10230; download=47621; total=0; expire=0 status=200 proxies: - client-fingerprint: chrome name: vless-test ... ``` 1. **Auto-detect fired and the Clash branch served the response.** `application/yaml; charset=utf-8` is set only on the Clash branch (`internal/sub/controller.go:914`), so your `mihomo/1.19.12` User-Agent matched `(?i)(clash|mihomo)` (`internal/web/service/setting.go:38`) and the server did **not** fall through to the raw base64 or HTML branch. 2. **The profile you received is complete, not truncated-empty.** Your `head -c 300` cut the body at 300 of 465 bytes, but the generator is unconditional — every Clash response is built from this map: ```go // internal/sub/clash_service.go:149-157 config := map[string]any{ "proxies": proxies, "proxy-groups": []map[string]any{{ "name": "PROXY", "type": "select", "proxies": proxyNames, }}, "rules": []string{"MATCH,PROXY"}, } ``` Keys are emitted alphabetically — visible in your own output, where the node's keys run `client-fingerprint`, `name`, `network`, `port`, `reality-opts`, `server`, `servername`, `tls` — so `proxy-groups:` and `rules:` sort after the `proxies:` block and sit in the 165 bytes your `head -c 300` discarded. An empty profile is impossible on this path anyway: `getClash` returns an empty string when there is nothing to serve (`internal/sub/clash_service.go:99-101`, `132-134`), the handler then takes `return false` at `controller.go:897-899`, and `writeSubError(c, nil)` sets `c.Status(http.StatusNotFound)` (`internal/sub/controller.go:37-41`). You would have gotten a `404`, not a `200`. 3. **`Subscription-Userinfo: upload=10230; download=47621`** shows the node itself has carried traffic. That matches your report that direct link import works. ## So what is failing The only failure signal anywhere in this thread is still the line from your first post: ``` http: TLS handshake error from 14.26.160.166:52509: write tcp 172.25.51.36:12096->14.26.160.166:52509: write: connection reset by peer ``` That string does not exist anywhere in this repository — it is Go's `net/http`, logged when the TLS handshake dies before any request line is read. Your `curl` ran on the server itself (`root@aio:~#`), so it exercised the loopback/hairpin path, **not** the path from `14.26.160.166`. The two are not the same test. Why one works and the other does not, stated as an inference rather than a source fact: your nodes are **REALITY on port 16509 masquerading as `aws.amazon.com`**, which is designed to survive exactly this. Your subscription fetch is ordinary TLS to your own domain on a non-standard port `12096`, presenting a 4-level Let's Encrypt chain that your own trace shows is 3420 bytes. Your server's local address `172.25.51.36` is private, so the box sits behind NAT. A peer RST arriving while the server is writing that large certificate flight is the signature of either path interference or a PMTU black hole — not of panel code. `internal/sub/sub.go:394-402` and `internal/web/web.go:620-637` build the two listeners identically, so there is no subscription-specific TLS behaviour to blame. ## What to do 1. **Run the same `curl` from the client's device, not from the server.** That is the test that has not been done yet. If it fails there and succeeds on the server, the panel is out of the picture. 2. **Have the client fetch the subscription through the proxy.** Mihomo, Clash Verge Rev and FlClash all have an option to route profile updates through the active node. Since your nodes work, this is the fastest workaround. 3. **Move the subscription behind 443 / a CDN.** Set the subscription port to `443`, or front it with a reverse proxy and set **Subscription URL** (`subURI`) so the links the panel hands out point at the public address — see [Panel settings](https://docs.sanaei.dev/docs/config/panel) and [Subscription](https://docs.sanaei.dev/docs/config/subscription). 4. **If the client does receive the profile and still shows nothing**, the remaining candidate is the REALITY + Mihomo ML-KEM interaction: your profile sets `reality-opts.support-x25519mlkem768: true` (`internal/sub/clash_service.go:1135`), and the constraints around it are written up at [REALITY → Mihomo and ML-KEM](https://docs.sanaei.dev/docs/config/reality). Two housekeeping notes. Your report said port **2096**; the server and both traces say **12096** — the URL your clients hold must carry `12096`. And the `> GET /…` request line in your last paste was not redacted, so your real subscription path and subscription ID are now public in this thread; rotate the client's subscription ID and change the subscription path in the panel. I am closing this as a configuration/network issue rather than a panel defect. If you run the `XUI_LOG_LEVEL=debug` check from my previous comment and the `Subscription request routed: branch=…` line shows `branch=raw` or `branch=html` for your real client, comment here with that line and it can be looked at again — that would be the one outcome that points back at the panel. Verdict: Not a bug (user configuration) Severity: N/A Confidence: High that there is no panel-side defect (proven by the reporter's own 200 response plus the source below); the network-path diagnosis is explicitly labelled an inference. Root cause: None in 3x-ui. The subscription server returns a complete, valid Mihomo profile for this subscription ID — confirmed end to end by the reporter's own `curl` (`status=200`, `application/yaml; charset=utf-8`, body beginning `proxies:`). The remaining failure is the TLS handshake being reset by the peer before any request line is read, which happens in Go's `net/http` below all panel code. Already fixed: Not applicable — v3.8.5 is the current release (`gh release list`), and no defect was found to fix. Duplicate of: None — `gh search issues --repo MHSanaei/3x-ui "clash subscription no nodes"`, `"subscription update no nodes"` and `"TLS handshake error subscription"` all returned no candidates. Evidence: `internal/sub/controller.go:914` `c.Data(200, "application/yaml; charset=utf-8", []byte(clashSub))` — that content type is emitted only by the Clash branch, so auto-detect fired for the reporter's UA; `internal/sub/clash_service.go:149-157` (`proxies` + `proxy-groups` + `rules` built unconditionally, so a `200` on this path is never an empty profile) with `internal/sub/clash_service.go:99-101` and `:132-134` returning an empty body — hence a `404` — when there is nothing to serve; `internal/web/service/setting.go:38` `DefaultSubClashUserAgentRegex = '(?i)(clash|mihomo)'`; `internal/sub/sub.go:394-402` vs `internal/web/web.go:620-637` (identical listener construction, no sub-specific TLS path); `internal/sub/clash_service.go:1135` `realityOpts["support-x25519mlkem768"] = true` with `docs/content/docs/en/config/reality.mdx:126-135`; no occurrence of the literal `TLS handshake error` anywhere in the Go source, confirming that line is stdlib `net/http`. Not determined: Whether the remote client's request reaches `:12096` at all. The reporter's `curl` ran on the server itself, so it does not test the external path; repeating it from the client's own device settles it in one command. I also made the title more specific — it was "[Bug]: Subscription cannot be used", which did not say which part failed. *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
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#4401
No description provided.