mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5264] [Bug]: Node traffic sync ignores TLS verify mode skip/pin for self-signed certificates #3686
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#3686
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 @wangzhijie0602 on GitHub (Jun 13, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5264
Describe the bug
When a remote node uses a self-signed TLS certificate, the node connection test works after setting TLS verify mode to
skiporpin.However, the background node traffic sync job still fails with:
the master node error log is:
WARNING - node traffic sync: fetch from SixtyNet failed: GET panel/api/inbounds/list: Get "https://1.2.3.4:8443/T6qP3mV8xK2rN7sL/panel/api/inbounds/list": tls: failed to verify certificate: x509: certificate signed by unknown authority
The slave node error log is:
813c8d019e64_3xui_app | 2026/06/13 11:10:10 http: TLS handshake error from 2.3.4.5:32884: remote error: tls: bad certificate
It appears that the background traffic sync request does not honor the per-node TLS verification mode.
How to reproduce the problem
skiporpin.Expected behavior
The node traffic sync job should use the selected TLS verify mode.
Actual behavior
The traffic sync job still verifies the certificate using the system CA store and fails with
x509: certificate signed by unknown authority.Relevant logs
Screenshots
No response
3x-ui version
3.1.1
Xray-core version
26.6.1
How did you install 3x-ui?
Docker / Docker Compose
Operating system
Debain 13
Which parts of the panel are affected?
Multi-node (sub-nodes)
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 13, 2026):
This is a confirmed bug. The node connection test and all background jobs (traffic sync, config reconcile, IP sync) use different HTTP clients, and only the connection test client honors the per-node TLS verification mode.
Root cause
internal/web/service/node.gocontainsnodeHTTPClientFor()(lines 61–95), which builds anhttp.Clientthat respectsTlsVerifyMode(verify/skip/pin) and thePinnedCertSha256field on the node model.NodeService.Probe()— the function behind the connection test button — callsnodeHTTPClientFor(n)directly, so it works correctly with self-signed certificates.All background remote operations (traffic snapshot fetches, config reconcile, IP sync, global traffic pushes) go through
Remote.do()ininternal/web/runtime/remote.go. That method uses a package-level singleton:No
TLSClientConfigis set on that transport. TheRemotestruct does hold the full*model.Node(includingTlsVerifyModeandPinnedCertSha256), butRemote.do()never consults those fields — it always callsremoteHTTPClient.Do(req), so Go's default certificate verification against the system CA store is used for every background call, regardless of the configured mode.The error in the logs is exactly what Go returns when this default verification fails against a self-signed certificate:
Affected operations
Every call routed through
Remote.do():FetchTrafficSnapshot(inbound list, online clients, last-online)ReconcileNode(add/update/delete inbounds on the node)FetchAllClientIps/PushAllClientIpsPushGlobalClientTrafficsUpdatePanel,RestartXray,GetWebCertFiles,GetDescendantsThe heartbeat job is unaffected because it calls
NodeService.Probe(), which does usenodeHTTPClientFor().Fix path
The
Remotetype already carries the node's TLS settings.Remote.do()needs to select an HTTP client based onr.node.TlsVerifyModeandr.node.PinnedCertSha256, using the same logic asnodeHTTPClientFor(). The most straightforward approach is to build and cache a per-RemoteHTTP client at construction time inNewRemote(), rather than relying on the shared singleton.This reply was generated automatically; a maintainer may follow up.
@MHSanaei commented on GitHub (Jun 13, 2026):
Fixed in
4c8d3cb6.The node probe honored the per-node TLS verify mode (skip/pin), but
runtime.Remoteused a shared HTTP client with no TLS config — so the background traffic sync (and every other remote operation) fell back to system-CA verification and rejected self-signed nodes even after you set skip/pin.The per-node TLS client builder is now the single source of truth (
HTTPClientForNode/DecodeCertPinin the runtime layer);Remotebuilds and caches its client through it, and the probe path delegates to the same builder, so the two can no longer diverge.