[GH-ISSUE #5987] [Question]: MTProto secret is now per-client (set via Clients page), not in the inbound form #4152

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

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

Describe the bug

When trying to create an MTProto inbound, the "secret" field is missing in the protocol tab as well as in the advanced section. If the inbound is created as is, no link is generated when attempting to export links.

How to reproduce the problem

Open Inbounds
Create an mtproto inbound

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

Image Image Image

3x-ui version

3.5.0

Xray-core version

26.7.11

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04 LTS

Which parts of the panel are affected?

Frontend (UI / panel pages)

Browser (only if it is a UI bug)

Firefox 152.0.6

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 @Farrier on GitHub (Jul 16, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5987 ### Describe the bug When trying to create an MTProto inbound, the "secret" field is missing in the protocol tab as well as in the advanced section. If the inbound is created as is, no link is generated when attempting to export links. ### How to reproduce the problem Open Inbounds Create an mtproto inbound ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots <img width="769" height="783" alt="Image" src="https://github.com/user-attachments/assets/61b35790-f5e3-4914-8122-7187d1c987d9" /> <img width="752" height="522" alt="Image" src="https://github.com/user-attachments/assets/78f760ae-7bac-45e5-b77c-cdd86ea3ff46" /> <img width="510" height="299" alt="Image" src="https://github.com/user-attachments/assets/5915b991-eb07-4dbe-ae42-7c268c08050f" /> ### 3x-ui version 3.5.0 ### Xray-core version 26.7.11 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 LTS ### Which parts of the panel are affected? Frontend (UI / panel pages) ### Browser (only if it is a UI bug) Firefox 152.0.6 ### 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:37:33 +07:00
  • closed this issue
  • added the
    question
    label
Author
Owner

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

This is expected behavior for the current MTProto implementation, not a bug. As of v3.5.0, MTProto inbounds are natively multi-client, and the FakeTLS secret moved from the inbound to the client. This is a deliberate, documented change (release notes: "MTProto goes multi-client... legacy single-secret inbounds migrate automatically to the clients model"), not a regression.

Where the secret actually is

  • The inbound Protocol tab (frontend/src/pages/inbounds/form/protocols/mtproto.tsx) only exposes fronting/network options — fakeTlsDomain, domain-fronting IP/port/proxy-protocol, proxyProtocolListener, preferIp, debug, throttleMaxConnections, routeThroughXray/outbound tag, publicIpv4/publicIpv6. There is no secret field there by design, and the Advanced JSON editor uses the same schema, so it isn't there either.
  • The secret (and the optional adTag) are per-client fields, set from Clients → Add Clients → Credentials tab (frontend/src/pages/clients/ClientFormModal.tsx, lines 865-874). A secret is auto-generated the first time a client is attached to an MTProto inbound (generateMtprotoSecret, same file, lines 362 and 386-390); a reload button regenerates it.
  • The backend enforces this deliberately: InboundService.normalizeMtprotoSecret (internal/web/service/inbound.go, lines 595-613) strips any inbound-level secret/adTag on every save and rebuilds only the per-client secrets. The code comment there is explicit: "Leaving an inbound-level secret behind is what produced stale links that failed with 'incorrect client random'." Client creation also rejects an MTProto client with an empty secret (same file, lines 806-808: "mtproto client requires a secret"). The commit that removed the old inbound-level secret is 84b64230 ("fix(mtproto): stop persisting a vestigial inbound-level secret").

Why no link was exported

A newly created inbound — MTProto or any other multi-client protocol — starts with zero clients. genInboundLinks (frontend/src/lib/xray/inbound-link.ts, lines 1206-1230) builds the export text by iterating the inbound's client list and returns an empty string when that list is empty; genMtprotoLink (same file, lines 789-798) likewise returns '' when the client secret is empty. Nothing errors — there is simply no client (and therefore no secret) yet.

How to get a working MTProto link

  1. Create the MTProto inbound (Protocol tab: FakeTLS domain plus any fronting/network options needed).
  2. Go to Clients in the sidebar → Add Clients, enter an email, and select this inbound under Attached inbounds.
  3. Open the Credentials tab — the secret is generated automatically; use the reload icon for a different one, and optionally set an ad-tag.
  4. Save. The client's tg://proxy link and QR code are then available from that client's row, and the inbound's Export action will include it.

Relabeling as question and closing as not a bug. Reopen if following the steps above still does not produce a working secret or link.

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

<!-- gh-comment-id:4987122760 --> @github-actions[bot] commented on GitHub (Jul 16, 2026): This is expected behavior for the current MTProto implementation, not a bug. As of **v3.5.0**, MTProto inbounds are natively multi-client, and the FakeTLS `secret` moved from the inbound to the client. This is a deliberate, documented change (release notes: "MTProto goes multi-client... legacy single-secret inbounds migrate automatically to the clients model"), not a regression. **Where the secret actually is** - The inbound Protocol tab (`frontend/src/pages/inbounds/form/protocols/mtproto.tsx`) only exposes fronting/network options — `fakeTlsDomain`, domain-fronting IP/port/proxy-protocol, `proxyProtocolListener`, `preferIp`, `debug`, `throttleMaxConnections`, `routeThroughXray`/outbound tag, `publicIpv4`/`publicIpv6`. There is no `secret` field there by design, and the Advanced JSON editor uses the same schema, so it isn't there either. - The `secret` (and the optional `adTag`) are per-client fields, set from **Clients → Add Clients → Credentials tab** (`frontend/src/pages/clients/ClientFormModal.tsx`, lines 865-874). A secret is auto-generated the first time a client is attached to an MTProto inbound (`generateMtprotoSecret`, same file, lines 362 and 386-390); a reload button regenerates it. - The backend enforces this deliberately: `InboundService.normalizeMtprotoSecret` (`internal/web/service/inbound.go`, lines 595-613) strips any inbound-level `secret`/`adTag` on every save and rebuilds only the per-client secrets. The code comment there is explicit: *"Leaving an inbound-level secret behind is what produced stale links that failed with 'incorrect client random'."* Client creation also rejects an MTProto client with an empty secret (same file, lines 806-808: `"mtproto client requires a secret"`). The commit that removed the old inbound-level secret is `84b64230` ("fix(mtproto): stop persisting a vestigial inbound-level secret"). **Why no link was exported** A newly created inbound — MTProto or any other multi-client protocol — starts with zero clients. `genInboundLinks` (`frontend/src/lib/xray/inbound-link.ts`, lines 1206-1230) builds the export text by iterating the inbound's client list and returns an empty string when that list is empty; `genMtprotoLink` (same file, lines 789-798) likewise returns `''` when the client secret is empty. Nothing errors — there is simply no client (and therefore no secret) yet. **How to get a working MTProto link** 1. Create the MTProto inbound (Protocol tab: FakeTLS domain plus any fronting/network options needed). 2. Go to **Clients** in the sidebar → **Add Clients**, enter an email, and select this inbound under **Attached inbounds**. 3. Open the **Credentials** tab — the secret is generated automatically; use the reload icon for a different one, and optionally set an ad-tag. 4. Save. The client's `tg://proxy` link and QR code are then available from that client's row, and the inbound's **Export** action will include it. Relabeling as `question` and closing as not a bug. Reopen if following the steps above still does not produce a working secret or link. *This reply was generated automatically; a maintainer may follow up.*
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#4152
No description provided.