[GH-ISSUE #5009] [Bug]: Cannot fully delete a cert domain #3524

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

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

Describe the bug

I was trying to switch my panel access from public net to tailscale, which I get a .<tailnet_name>.ts.net magic url to use. So I tried to switch. However, it seems like there is no way I could delete the previous domain and its certificates. The only option in the x-ui script is to revoke it.

How to reproduce the problem

  1. do sudo x-ui
  2. go to option 19 SSL Certificate Management
  3. There is no deletion.

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 LTS

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 @Michael-YS on GitHub (Jun 6, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5009 ### Describe the bug I was trying to switch my panel access from public net to tailscale, which I get a <hostname>.<tailnet_name>.ts.net magic url to use. So I tried to switch. However, it seems like there is no way I could delete the previous domain and its certificates. The only option in the x-ui script is to revoke it. ### How to reproduce the problem 1. do `sudo x-ui` 2. go to option 19 `SSL Certificate Management` 3. There is no deletion. ### 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 LTS ### 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:33:03 +07:00
Author
Owner

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

Thanks for the clear report. This is a confirmed gap in the SSL Certificate Management menu.

What the menu currently offers (option 19)

Looking at x-ui.sh, ssl_cert_issue_main() only provides:

  1. Get SSL (Domain)
  2. Revoke
  3. Force Renew
  4. Show Existing Domains
  5. Set Cert paths for the panel
  6. Get SSL for IP Address

There is no "Delete" option. The Revoke option only calls acme.sh --revoke -d <domain> — it notifies Let's Encrypt to revoke the cert, but leaves local files under /root/cert/<domain>/, leaves acme.sh's internal tracking state under ~/.acme.sh/<domain>, and does not clear the panel's configured cert paths from the database.


Workaround — manually clean up the old domain

Run these commands on your server (replace <old-domain> with your previous domain):

# 1. Remove the domain from acme.sh tracking (stops auto-renewal attempts)
~/.acme.sh/acme.sh --remove -d <old-domain>

# 2. Delete local cert files
rm -rf /root/cert/<old-domain>

# 3. Clear the cert paths stored in x-ui's settings database
x-ui cert -reset

# 4. Restart the panel
x-ui restart

Step 3 (x-ui cert -reset) calls updateCert("", "") internally, which clears webCertFile, webKeyFile, subCertFile, and subKeyFile in the DB — the panel will stop attempting to serve TLS with the old cert.


Note for Tailscale

If you're switching to a <hostname>.<tailnet>.ts.net magic DNS address, the panel will be accessible over Tailscale's encrypted tunnel without needing a separate certificate. You can leave the panel in HTTP-only mode within your Tailnet, or look into Tailscale's HTTPS certificate feature (tailscale cert) if you want a valid TLS cert for your ts.net hostname.


A Delete option in the menu (combining the three cleanup steps above) would be a straightforward and useful addition. PRs are welcome!

<!-- gh-comment-id:4638460462 --> @github-actions[bot] commented on GitHub (Jun 6, 2026): Thanks for the clear report. This is a confirmed gap in the SSL Certificate Management menu. **What the menu currently offers (option 19)** Looking at `x-ui.sh`, `ssl_cert_issue_main()` only provides: 1. Get SSL (Domain) 2. Revoke 3. Force Renew 4. Show Existing Domains 5. Set Cert paths for the panel 6. Get SSL for IP Address There is no "Delete" option. The **Revoke** option only calls `acme.sh --revoke -d <domain>` — it notifies Let's Encrypt to revoke the cert, but leaves local files under `/root/cert/<domain>/`, leaves acme.sh's internal tracking state under `~/.acme.sh/<domain>`, and does not clear the panel's configured cert paths from the database. --- **Workaround — manually clean up the old domain** Run these commands on your server (replace `<old-domain>` with your previous domain): ```bash # 1. Remove the domain from acme.sh tracking (stops auto-renewal attempts) ~/.acme.sh/acme.sh --remove -d <old-domain> # 2. Delete local cert files rm -rf /root/cert/<old-domain> # 3. Clear the cert paths stored in x-ui's settings database x-ui cert -reset # 4. Restart the panel x-ui restart ``` Step 3 (`x-ui cert -reset`) calls `updateCert("", "")` internally, which clears `webCertFile`, `webKeyFile`, `subCertFile`, and `subKeyFile` in the DB — the panel will stop attempting to serve TLS with the old cert. --- **Note for Tailscale** If you're switching to a `<hostname>.<tailnet>.ts.net` magic DNS address, the panel will be accessible over Tailscale's encrypted tunnel without needing a separate certificate. You can leave the panel in HTTP-only mode within your Tailnet, or look into Tailscale's HTTPS certificate feature (`tailscale cert`) if you want a valid TLS cert for your ts.net hostname. --- A **Delete** option in the menu (combining the three cleanup steps above) would be a straightforward and useful addition. PRs are welcome\!
Author
Owner

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

Fixed in 8ce61f3c. The certificate menu option is now "Revoke & Remove": it revokes via acme.sh, removes the acme.sh tracking/state directories (including the _ecc variant), deletes the local files under /root/cert/<domain>, and resets the panel cert paths if that domain was in use. Included in v3.3.0.

<!-- gh-comment-id:4685766827 --> @MHSanaei commented on GitHub (Jun 11, 2026): Fixed in 8ce61f3c. The certificate menu option is now "Revoke & Remove": it revokes via acme.sh, removes the acme.sh tracking/state directories (including the `_ecc` variant), deletes the local files under `/root/cert/<domain>`, and resets the panel cert paths if that domain was in use. Included in v3.3.0.
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#3524
No description provided.