[GH-ISSUE #5822] [Bug]: SSL issuance script fails on IPv6-Only servers (Missing --listen-v6 flag) #4047

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

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

  • 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 @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::a: 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 ```shell ``` ### 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 - [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:36:46 +07:00
Author
Owner

@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 an acme_listen_flag helper:

~/.acme.sh/acme.sh --issue -d DOMAIN <acme_listen_flag output> --standalone --httpport WEBPORT --force

acme_listen_flag() (x-ui.sh lines 53-63) decides that flag automatically:

acme_listen_flag() {
    if ip -4 addr show scope global 2> /dev/null | grep -q "inet "; then
        echo ""
    else
        echo "--listen-v6"
    fi
}

If the host has no globally-scoped IPv4 address, the script already appends --listen-v6 automatically. This was added in commit dbee150b to 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-v6 without manual intervention. Seeing Connection refused on the IPv6 address anyway points to one of two possibilities:

  1. /usr/bin/x-ui on the server is out of sync with the reported panel version (the shell script and the Go binary are normally updated together by update.sh, but this is worth confirming directly rather than assuming).
  2. ip -4 addr show scope global is 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 the grep -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:

grep -n "acme_listen_flag" /usr/bin/x-ui
ip -4 addr show scope global

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-ui does not contain acme_listen_flag at 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.

<!-- gh-comment-id:4887137038 --> @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 an `acme_listen_flag` helper: ```bash ~/.acme.sh/acme.sh --issue -d DOMAIN <acme_listen_flag output> --standalone --httpport WEBPORT --force ``` `acme_listen_flag()` (`x-ui.sh` lines 53-63) decides that flag automatically: ```bash acme_listen_flag() { if ip -4 addr show scope global 2> /dev/null | grep -q "inet "; then echo "" else echo "--listen-v6" fi } ``` If the host has no globally-scoped IPv4 address, the script already appends `--listen-v6` automatically. This was added in commit `dbee150b` to 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-v6` without manual intervention. Seeing `Connection refused` on the IPv6 address anyway points to one of two possibilities: 1. `/usr/bin/x-ui` on the server is out of sync with the reported panel version (the shell script and the Go binary are normally updated together by `update.sh`, but this is worth confirming directly rather than assuming). 2. `ip -4 addr show scope global` is 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 the `grep -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: ```bash grep -n "acme_listen_flag" /usr/bin/x-ui ip -4 addr show scope global ``` 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-ui` does not contain `acme_listen_flag` at 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.*
Author
Owner

@Sudo-Winnie 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 an acme_listen_flag helper:当前脚本的功能: ssl_cert_issue() ( x-ui.sh , "获取 SSL(域名)", 菜单选项 20) 调用 acme.sh,并使用由 acme_listen_flag 辅助函数生成的监听标志:

~/.acme.sh/acme.sh --issue -d DOMAIN <acme_listen_flag output> --standalone --httpport WEBPORT --force
acme_listen_flag() (x-ui.sh lines 53-63) decides that flag automatically:acme_listen_flag() ( x-ui.sh 第 53-63 行)自动决定该标志:

acme_listen_flag() {
if ip -4 addr show scope global 2> /dev/null | grep -q "inet "; then
echo ""
else
echo "--listen-v6"
fi
}
If the host has no globally-scoped IPv4 address, the script already appends --listen-v6 automatically. This was added in commit dbee150b to fix #4994, #4467, #4468 and #3960, and shipped in v3.3.1, so it should already be present in a v3.4.2 install.如果主机没有全局作用域的 IPv4 地址,脚本会自动添加 --listen-v6 参数。此功能是在提交 dbee150b 中添加的,用于修复 #4994 、 #4467 、 #4468 和 #3960 问题,并已包含在 v3.3.1 版本中,因此在 v3.4.2 版本中应该已经存在。

Given that, an IPv6-only host should already receive --listen-v6 without manual intervention. Seeing Connection refused on the IPv6 address anyway points to one of two possibilities:鉴于此,仅支持 IPv6 的主机应该无需手动干预即可收到 --listen-v6 。如果仍然在 IPv6 地址上看到 Connection refused 则可能存在以下两种情况之一:

  1. /usr/bin/x-ui on the server is out of sync with the reported panel version (the shell script and the Go binary are normally updated together by update.sh, but this is worth confirming directly rather than assuming).服务器上的 /usr/bin/x-ui 与报告的面板版本不同步(shell 脚本和 Go 二进制文件通常由 update.sh 一起更新,但这值得直接确认,而不是假设)。
  2. ip -4 addr show scope global is 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 the grep -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.ip -4 addr show scope global 匹配到主机上的某个地址(例如用于 NAT64/464XLAT 出站连接的私有/CGNAT IPv4、Docker 网桥或隧道接口),该地址满足 grep -q "inet " 检查,因此脚本得出结论,主机具有可用的 IPv4 并跳过 --listen-v6 ,即使该地址无法公开访问,并且该域只有 AAAA 记录。

To confirm which of these applies, please run and share the output of:为确认以上哪项适用,请运行以下命令并分享输出结果:

grep -n "acme_listen_flag" /usr/bin/x-ui
ip -4 addr show scope global
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-ui does not contain acme_listen_flag at all, running the panel update from the main menu (option 4) or the update.sh installer should pull in the existing fix.如果 (2) 成立,则检测结果需要比“存在任何全局 IPv4 地址”更具体(例如,检查该地址是否实际可公开路由,或者在假定 IPv4 可用之前检查该域名是否具有匹配的 A 记录)。如果 /usr/bin/x-ui 根本不包含 acme_listen_flag ,则从主菜单运行面板更新(选项 4)或运行 update.sh 安装程序应该可以应用现有的修复程序。

This reply was generated automatically; a maintainer may follow up.此回复为自动生成,维护人员可能会跟进。

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
root@xxx:
# ip -4 addr show scope global
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

<!-- gh-comment-id:4887193444 --> @Sudo-Winnie 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 an `acme_listen_flag` helper:**当前脚本的功能:** `ssl_cert_issue()` ( `x-ui.sh` , "获取 SSL(域名)", 菜单选项 20) 调用 acme.sh,并使用由 `acme_listen_flag` 辅助函数生成的监听标志: > > ~/.acme.sh/acme.sh --issue -d DOMAIN <acme_listen_flag output> --standalone --httpport WEBPORT --force > `acme_listen_flag()` (`x-ui.sh` lines 53-63) decides that flag automatically:`acme_listen_flag()` ( `x-ui.sh` 第 53-63 行)自动决定该标志: > > acme_listen_flag() { > if ip -4 addr show scope global 2> /dev/null | grep -q "inet "; then > echo "" > else > echo "--listen-v6" > fi > } > If the host has no globally-scoped IPv4 address, the script already appends `--listen-v6` automatically. This was added in commit `dbee150b` to fix [#4994](https://github.com/MHSanaei/3x-ui/issues/4994), [#4467](https://github.com/MHSanaei/3x-ui/issues/4467), [#4468](https://github.com/MHSanaei/3x-ui/issues/4468) and [#3960](https://github.com/MHSanaei/3x-ui/issues/3960), and shipped in v3.3.1, so it should already be present in a v3.4.2 install.如果主机没有全局作用域的 IPv4 地址,脚本会自动添加 `--listen-v6` 参数。此功能是在提交 `dbee150b` 中添加的,用于修复 [#4994](https://github.com/MHSanaei/3x-ui/issues/4994) 、 [#4467](https://github.com/MHSanaei/3x-ui/issues/4467) 、 [#4468](https://github.com/MHSanaei/3x-ui/issues/4468) 和 [#3960](https://github.com/MHSanaei/3x-ui/issues/3960) 问题,并已包含在 v3.3.1 版本中,因此在 v3.4.2 版本中应该已经存在。 > > Given that, an IPv6-only host should already receive `--listen-v6` without manual intervention. Seeing `Connection refused` on the IPv6 address anyway points to one of two possibilities:鉴于此,仅支持 IPv6 的主机应该无需手动干预即可收到 `--listen-v6` 。如果仍然在 IPv6 地址上看到 `Connection refused` 则可能存在以下两种情况之一: > > 1. `/usr/bin/x-ui` on the server is out of sync with the reported panel version (the shell script and the Go binary are normally updated together by `update.sh`, but this is worth confirming directly rather than assuming).服务器上的 `/usr/bin/x-ui` 与报告的面板版本不同步(shell 脚本和 Go 二进制文件通常由 `update.sh` 一起更新,但这值得直接确认,而不是假设)。 > 2. `ip -4 addr show scope global` is 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 the `grep -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.`ip -4 addr show scope global` 匹配到主机上的某个地址(例如用于 NAT64/464XLAT 出站连接的私有/CGNAT IPv4、Docker 网桥或隧道接口),该地址满足 `grep -q "inet "` 检查,因此脚本得出结论,主机具有可用的 IPv4 并跳过 `--listen-v6` ,即使该地址无法公开访问,并且该域只有 AAAA 记录。 > > To confirm which of these applies, please run and share the output of:为确认以上哪项适用,请运行以下命令并分享输出结果: > > grep -n "acme_listen_flag" /usr/bin/x-ui > ip -4 addr show scope global > 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-ui` does not contain `acme_listen_flag` at all, running the panel update from the main menu (option 4) or the update.sh installer should pull in the existing fix.如果 (2) 成立,则检测结果需要比“存在任何全局 IPv4 地址”更具体(例如,检查该地址是否实际可公开路由,或者在假定 IPv4 可用之前检查该域名是否具有匹配的 A 记录)。如果 `/usr/bin/x-ui` 根本不包含 `acme_listen_flag` ,则从主菜单运行面板更新(选项 4)或运行 update.sh 安装程序应该可以应用现有的修复程序。 > > _This reply was generated automatically; a maintainer may follow up.此回复为自动生成,维护人员可能会跟进。_ 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 root@xxx:~# ip -4 addr show scope global 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
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#4047
No description provided.