[GH-ISSUE #5070] [Bug]: Multidomain certificate makes x-ui shows wrong panel's path #3569

Closed
opened 2026-10-31 20:33:23 +07:00 by bsakaguchi · 2 comments
Owner

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

Describe the bug

I'm using Lets Encrypt multidomain (several sub domains of one domain.de) certificate and news.domain.de is used for Panel's access and news.domain.de was used by installation.
Panel is correctly accessed by URL https://news.domain.de:8888/gomanuke/panel/settings#general
But x-ui reports wrong URL and wrong certificate.

How to reproduce the problem

Get by Lets Encrypt a certificate's files pair with domain and its subdomains.
Set it in Panel's CUI config
/etc/letsencrypt/live/part.domain.de/fullchain.pem
/etc/letsencrypt/live/part.domain.de/privkey.pem

Run x-ui in ssh and Check menu 10 (View Settings) it shows

[INF] current panel settings as follows:
Panel is secure with SSL
hasDefaultCredential: false
port: 8888
webBasePath: /gomanuke/
Database: SQLite (/etc/x-ui/x-ui.db)
Access URL: https://part.domain.de:8888/gomanuke

19-4 SSL (Certificate Management-Show Existing Domains)

ind: ‘/root/cert/’: No such file or directory
No certificates found

Expected behavior

So x-ui shows part.domain.de:8888/gomanuke instead of

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

Debian 13

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?

No — direct access

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 @gomanuke on GitHub (Jun 8, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5070 ### Describe the bug I'm using Lets Encrypt multidomain (several sub domains of one domain.de) certificate and news.domain.de is used for Panel's access and news.domain.de was used by installation. Panel is correctly accessed by URL https://news.domain.de:8888/gomanuke/panel/settings#general But x-ui reports wrong URL and wrong certificate. ### How to reproduce the problem Get by Lets Encrypt a certificate's files pair with domain and its subdomains. Set it in Panel's CUI config /etc/letsencrypt/live/part.domain.de/fullchain.pem /etc/letsencrypt/live/part.domain.de/privkey.pem Run x-ui in ssh and Check menu 10 (View Settings) it shows [INF] current panel settings as follows: Panel is secure with SSL hasDefaultCredential: false port: 8888 webBasePath: /gomanuke/ Database: SQLite (/etc/x-ui/x-ui.db) Access URL: https://part.domain.de:8888/gomanuke 19-4 SSL (Certificate Management-Show Existing Domains) **ind: ‘/root/cert/’: No such file or directory No certificates found** ### Expected behavior So x-ui shows part.domain.de:8888/gomanuke instead of ### 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 Debian 13 ### 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? No — direct access ### 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:33:23 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

Thanks for the detailed report. I traced both behaviours to specific logic in x-ui.sh.


Issue 1 — Access URL shows part.domain.de instead of news.domain.de

In x-ui.sh (around line 363), the View Settings display derives the hostname purely from the directory name that contains the configured certificate file:

local domain=$(basename "$(dirname "$existing_cert")")

Because your cert path is /etc/letsencrypt/live/part.domain.de/fullchain.pem, this gives:

dirname  → /etc/letsencrypt/live/part.domain.de
basename → part.domain.de

The script has no awareness of which SAN entry in a multi-domain certificate is actually used to reach the panel — it just reads the folder name. Since Let's Encrypt names that folder after the first/primary domain in the cert (part.domain.de), the displayed URL is https://part.domain.de:8888/gomanuke even though the panel is correctly reachable at https://news.domain.de:8888/gomanuke.

Important: this is only a display issue in the x-ui management menu. The panel itself serves the correct certificate and is accessed at the right address — no runtime impact.


Issue 2 — "Show Existing Domains" (19 → 4) reports no certificates

That sub-menu (also in x-ui.sh, around line 1235) hard-codes the search path:

local domains=$(find /root/cert/ -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)

It only looks inside /root/cert/, which is where the panel's own built-in acme.sh workflow stores certificates. Because your cert lives in /etc/letsencrypt/live/, it is invisible to this menu — hence the find: '/root/cert/': No such file or directory message.


Workaround (until the display logic is improved)

There is no setting today to specify a "display hostname" independently of the cert path. The practical options are:

  1. Ignore the display — the panel is working correctly; the menu output is cosmetic.
  2. Re-issue the cert through the built-in tool — use SSL Certificate Management → 1 to issue a certificate specifically for news.domain.de via acme.sh. That places the cert in /root/cert/news.domain.de/, after which both the Access URL display and the "Show Existing Domains" menu will work as expected. You would then point the panel settings at the new cert files.
  3. Symlink workaround — create /root/cert/news.domain.de/ and symlink the fullchain/privkey from the Let's Encrypt path into it. This satisfies the hardcoded /root/cert/ search without changing your actual cert files:
    mkdir -p /root/cert/news.domain.de
    ln -s /etc/letsencrypt/live/part.domain.de/fullchain.pem /root/cert/news.domain.de/fullchain.pem
    ln -s /etc/letsencrypt/live/part.domain.de/privkey.pem   /root/cert/news.domain.de/privkey.pem
    

This is a real limitation in the shell script logic: it should use a configurable panel hostname or parse the cert's SANs rather than assuming the folder name equals the access domain. Marking as bug for the maintainers to address.

<!-- gh-comment-id:4645277926 --> @github-actions[bot] commented on GitHub (Jun 8, 2026): Thanks for the detailed report. I traced both behaviours to specific logic in `x-ui.sh`. --- ## Issue 1 — Access URL shows `part.domain.de` instead of `news.domain.de` In `x-ui.sh` (around line 363), the **View Settings** display derives the hostname purely from the **directory name** that contains the configured certificate file: ```bash local domain=$(basename "$(dirname "$existing_cert")") ``` Because your cert path is `/etc/letsencrypt/live/part.domain.de/fullchain.pem`, this gives: ``` dirname → /etc/letsencrypt/live/part.domain.de basename → part.domain.de ``` The script has no awareness of which SAN entry in a multi-domain certificate is actually used to reach the panel — it just reads the folder name. Since Let's Encrypt names that folder after the first/primary domain in the cert (`part.domain.de`), the displayed URL is `https://part.domain.de:8888/gomanuke` even though the panel is correctly reachable at `https://news.domain.de:8888/gomanuke`. **Important:** this is only a display issue in the `x-ui` management menu. The panel itself serves the correct certificate and is accessed at the right address — no runtime impact. --- ## Issue 2 — "Show Existing Domains" (19 → 4) reports no certificates That sub-menu (also in `x-ui.sh`, around line 1235) hard-codes the search path: ```bash local domains=$(find /root/cert/ -mindepth 1 -maxdepth 1 -type d -exec basename {} \;) ``` It **only** looks inside `/root/cert/`, which is where the panel's own built-in acme.sh workflow stores certificates. Because your cert lives in `/etc/letsencrypt/live/`, it is invisible to this menu — hence the `find: '/root/cert/': No such file or directory` message. --- ## Workaround (until the display logic is improved) There is no setting today to specify a "display hostname" independently of the cert path. The practical options are: 1. **Ignore the display** — the panel is working correctly; the menu output is cosmetic. 2. **Re-issue the cert through the built-in tool** — use **SSL Certificate Management → 1** to issue a certificate specifically for `news.domain.de` via acme.sh. That places the cert in `/root/cert/news.domain.de/`, after which both the Access URL display and the "Show Existing Domains" menu will work as expected. You would then point the panel settings at the new cert files. 3. **Symlink workaround** — create `/root/cert/news.domain.de/` and symlink the fullchain/privkey from the Let's Encrypt path into it. This satisfies the hardcoded `/root/cert/` search without changing your actual cert files: ```bash mkdir -p /root/cert/news.domain.de ln -s /etc/letsencrypt/live/part.domain.de/fullchain.pem /root/cert/news.domain.de/fullchain.pem ln -s /etc/letsencrypt/live/part.domain.de/privkey.pem /root/cert/news.domain.de/privkey.pem ``` --- This is a real limitation in the shell script logic: it should use a configurable panel hostname or parse the cert's SANs rather than assuming the folder name equals the access domain. Marking as **bug** for the maintainers to address.
Author
Owner

@MHSanaei commented on GitHub (Jun 11, 2026):

Fixed in dbee150b. The displayed Access URL was derived from the certificate folder name, which for a multidomain (SAN) certificate is just its first domain. The script now reads the certificate''s actual SAN list, shows the other names the certificate covers, and "Show Existing Domains" also lists the panel''s configured certificate when it lives outside /root/cert (e.g. under /etc/letsencrypt). Will be in the next release.

<!-- gh-comment-id:4685992021 --> @MHSanaei commented on GitHub (Jun 11, 2026): Fixed in dbee150b. The displayed Access URL was derived from the certificate folder name, which for a multidomain (SAN) certificate is just its first domain. The script now reads the certificate''s actual SAN list, shows the other names the certificate covers, and "Show Existing Domains" also lists the panel''s configured certificate when it lives outside /root/cert (e.g. under /etc/letsencrypt). Will be in the next release.
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#3569
No description provided.