[GH-ISSUE #4854] [Bug]: Certificate in TLS mode on the remote panel #3383

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

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

Describe the bug

2 servers - primary and secondary

The secondary one was added as a node

The remote control panel certificate is not installed correctly

How to reproduce the problem

When creating a connection from the primary server to the secondary server with TLS security and clicking "Install Panel Certificate," the primary server's certificate is entered. When saving this connection, the secondary server's kernel encounters an error due to an incorrect path to the certificate.

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.2.6

Xray-core version

26.6.1

How did you install 3x-ui?

install.sh script

Operating system

ubuntu 22.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 @Kenaed on GitHub (Jun 3, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4854 ### Describe the bug 2 servers - primary and secondary The secondary one was added as a node The remote control panel certificate is not installed correctly ### How to reproduce the problem When creating a connection from the primary server to the secondary server with TLS security and clicking "Install Panel Certificate," the primary server's certificate is entered. When saving this connection, the secondary server's kernel encounters an error due to an incorrect path to the certificate. ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.2.6 ### Xray-core version 26.6.1 ### How did you install 3x-ui? install.sh script ### Operating system ubuntu 22.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:03 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

Thanks for filing a focused report — this confirms a real bug.

Confirmed root cause

The "Set Cert from Panel" button (pages.inbounds.setDefaultCert) is implemented in
frontend/src/pages/inbounds/form/useSecurityActions.ts, lines 112–134.

When clicked, it calls POST /panel/setting/all and reads the local panel's webCertFile / webKeyFile settings:

const msg = await HttpUtil.post('/panel/setting/all', undefined, { silent: true });
// ...
const obj = msg.obj as { webCertFile?: string; webKeyFile?: string };
form.setFieldValue(['streamSettings', 'tlsSettings', 'certificates', certName, 'certificateFile'], obj.webCertFile ?? '');
form.setFieldValue(['streamSettings', 'tlsSettings', 'certificates', certName, 'keyFile'], obj.webKeyFile ?? '');

This always queries the primary panel regardless of which node the inbound is assigned to. The file paths it inserts (e.g. /root/cert/primary-domain/fullchain.pem) exist on the primary server but not on the secondary server.

The backend sanitization in web/runtime/remote.go (sanitizeStreamSettingsForRemote()) does not remove these paths either — it only strips file paths when inline certificate content is also present. When the cert is file-only (the typical result of using this button), the wrong primary-server paths are passed through unchanged to the remote node's Xray config, causing Xray to fail at startup.

Workaround until a fix is released

Do not use "Set Cert from Panel" when creating/editing an inbound that is assigned to a remote node. Instead, manually type the certificate and key file paths as they exist on the secondary server's filesystem directly into the Certificate file and Key file fields.

For example, if your secondary server's certificate lives at /root/cert/secondary-domain/fullchain.pem, enter that path manually.

If Xray on the secondary node is already failing because of incorrect paths that were inserted previously, you can correct the paths by editing the inbound from the primary panel and replacing the certificate file fields with the correct paths for the remote server.

<!-- gh-comment-id:4611643512 --> @github-actions[bot] commented on GitHub (Jun 3, 2026): Thanks for filing a focused report — this confirms a real bug. ## Confirmed root cause The **"Set Cert from Panel"** button (`pages.inbounds.setDefaultCert`) is implemented in `frontend/src/pages/inbounds/form/useSecurityActions.ts`, lines 112–134. When clicked, it calls `POST /panel/setting/all` and reads the **local panel's** `webCertFile` / `webKeyFile` settings: ```typescript const msg = await HttpUtil.post('/panel/setting/all', undefined, { silent: true }); // ... const obj = msg.obj as { webCertFile?: string; webKeyFile?: string }; form.setFieldValue(['streamSettings', 'tlsSettings', 'certificates', certName, 'certificateFile'], obj.webCertFile ?? ''); form.setFieldValue(['streamSettings', 'tlsSettings', 'certificates', certName, 'keyFile'], obj.webKeyFile ?? ''); ``` This always queries the **primary panel** regardless of which node the inbound is assigned to. The file paths it inserts (e.g. `/root/cert/primary-domain/fullchain.pem`) exist on the primary server but not on the secondary server. The backend sanitization in `web/runtime/remote.go` (`sanitizeStreamSettingsForRemote()`) does not remove these paths either — it only strips file paths when inline certificate content is *also* present. When the cert is file-only (the typical result of using this button), the wrong primary-server paths are passed through unchanged to the remote node's Xray config, causing Xray to fail at startup. ## Workaround until a fix is released Do not use "Set Cert from Panel" when creating/editing an inbound that is assigned to a remote node. Instead, manually type the certificate and key file paths as they exist **on the secondary server's filesystem** directly into the `Certificate file` and `Key file` fields. For example, if your secondary server's certificate lives at `/root/cert/secondary-domain/fullchain.pem`, enter that path manually. If Xray on the secondary node is already failing because of incorrect paths that were inserted previously, you can correct the paths by editing the inbound from the primary panel and replacing the certificate file fields with the correct paths for the remote server.
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#3383
No description provided.