mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #6021] [Question]: sub and config problem in tg bot #4170
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#4170
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 @1sardaar on GitHub (Jul 17, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6021
What are you trying to do?
Also, when retrieving the configuration link, a certificate-related error occurs because the domain is incomplete.
How should I fix this?
What have you already tried?
No response
3x-ui version
3.5.0
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 22.04
Screenshots or config snippets
Before submitting
@github-actions[bot] commented on GitHub (Jul 17, 2026):
This is the same issue as #5851, where the root cause was already confirmed in the source and is still present on
3.5.0.Root cause: the Telegram bot builds subscription/config links in
buildSubscriptionURLs(internal/web/service/tgbot/tgbot_client.go:142-177). It resolves the host in this order:subURI(Subscription Settings -> Reverse Proxy URI), used verbatim if set.subDomain(Subscription Settings -> Listen Domain).webDomain(Panel Settings -> Listen Domain).os.Hostname(), cached at bot startup)."localhost".Both
subDomainandwebDomaindefault to an empty string (internal/web/service/setting.go:46,101). When neither is set, the bot falls through to the OS hostname, which is normally just the machine's short label - no subdomain, no TLD - matching what you're seeing. This also explains the certificate error on the config link: your TLS certificate's SAN covers your real FQDN, not the bare hostname the bot inserted into the URL, so validation fails.The panel/web UI does not have this problem because its subscription link is built from the incoming HTTP request's
Hostheader whensubDomainis blank (BuildSubURIBaseininternal/web/service/setting.go:1339) - the bot has no HTTP request to read a host from, so it can't do the same.Fix: in the panel, go to Panel Settings -> Subscription Settings and set either:
Listen Domain(subDomain) to your full domain, e.g.sub.example.com, orReverse Proxy URI(subURI) to the full base URL, e.g.https://sub.example.com/sub/subURI/subDomainare checked before the hostname fallback, so either one will make the bot's links match your real domain and certificate.Closing as a duplicate of #5851 - please continue the discussion there if this does not resolve it.
This reply was generated automatically; a maintainer may follow up.