mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5822] [Bug]: SSL issuance script fails on IPv6-Only servers (Missing --listen-v6 flag) #4047
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4047
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sudo-Winnie on GitHub (Jul 5, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5822
Describe the bug
The default SSL certificate issuance script fails when executed on an IPv6-Only server.
Environment
OS: Debian 13 (IPv6-Only vps)
Working Command:
/root/.acme.sh/acme.sh --issue -d example.com --standalone --listen-v6
How to reproduce the problem
Run the script on an IPv6-Only server.
Choose Option 20. SSL Certificate Management to get an SSL certificate.
Enter the domain name and use the default port 80.
The ACME challenge fails with a Connection refused error when Let's Encrypt tries to fetch the challenge token over IPv6:
[Mon Jul 6 02:00:31 AM +08 2026] Single domain='example.com'
[Mon Jul 6 02:00:34 AM +08 2026] Getting webroot for domain='example.com'
[Mon Jul 6 02:00:34 AM +08 2026] Verifying: example.com
[Mon Jul 6 02:00:34 AM +08 2026] Standalone mode server
[Mon Jul 6 02:00:37 AM +08 2026] Pending. The CA is processing your order, please wait. (1/30)
[Mon Jul 6 02:00:41 AM +08 2026] example.com: Invalid status. Verification error details: ffff:ffff:ffff:ff:🅰️ Fetching http://example.com/.well-known/acme-challenge/S6jmgJntbHeGp8PKk4IJwY6cl9ydSPnW0FKIY_nbq6w: Connection refused
[Mon Jul 6 02:00:41 AM +08 2026] Please add '--debug' or '--log' to see more information.
[Mon Jul 6 02:00:41 AM +08 2026] See: https://github.com/acmesh-official/acme.sh/wiki/How-to-debug-acme.sh
[ERR] Issuing certificate failed, please check logs.
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.4.2
Xray-core version
26.6.27
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 response
Before submitting
@github-actions[bot] commented on GitHub (Jul 5, 2026):
This looks already addressed in the code path described here, so the likely cause is different from the title.
What the current script does:
ssl_cert_issue()(x-ui.sh, "Get SSL (Domain)" under menu option 20) calls acme.sh with a listen flag produced by anacme_listen_flaghelper:acme_listen_flag()(x-ui.shlines 53-63) decides that flag automatically:If the host has no globally-scoped IPv4 address, the script already appends
--listen-v6automatically. This was added in commitdbee150bto fix #4994, #4467, #4468 and #3960, and shipped in v3.3.1, so it should already be present in a v3.4.2 install.Given that, an IPv6-only host should already receive
--listen-v6without manual intervention. SeeingConnection refusedon the IPv6 address anyway points to one of two possibilities:/usr/bin/x-uion the server is out of sync with the reported panel version (the shell script and the Go binary are normally updated together byupdate.sh, but this is worth confirming directly rather than assuming).ip -4 addr show scope globalis matching some address on the box (for example a private/CGNAT IPv4 used for NAT64/464XLAT outbound connectivity, a Docker bridge, or a tunnel interface) that satisfies thegrep -q "inet "check, so the script concludes the host has usable IPv4 and skips--listen-v6, even though that address is not publicly reachable and the domain only has an AAAA record.To confirm which of these applies, please run and share the output of:
If (2) is confirmed, the detection would need to be more specific than "any global-scope IPv4 exists" (for example, checking the address is actually publicly routable, or checking whether the domain has a matching A record before assuming IPv4 is usable). If
/usr/bin/x-uidoes not containacme_listen_flagat all, running the panel update from the main menu (option 4) or the update.sh installer should pull in the existing fix.This reply was generated automatically; a maintainer may follow up.
@Sudo-Winnie commented on GitHub (Jul 5, 2026):
root@xxx:~# grep -n "acme_listen_flag" /usr/bin/x-ui
57:acme_listen_flag() {
1850:
/.acme.sh/acme.sh --issue -d ${domain} $(acme_listen_flag) --standalone --httpport ${WebPort} --force# ip -4 addr show scope globalroot@xxx:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
altname enp3s0
altname enx00b2f5c4fbd3
inet 10.10.90.24/24 brd 10.10.90.255 scope global eth0
valid_lft forever preferred_lft forever