mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #4793] [Bug]: Misleading tooltip for Pinned Peer Cert SHA-256 #3330
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#3330
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 @my-johnlee on GitHub (Jun 2, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4793
Describe the bug
The tooltip said to mentioned to base64 encode but it shouldn't be.
How to reproduce the problem
Despite what that tooltip says, you should still paste your standard Hexadecimal (Hex) string (e.g., e8e2d3...) into that field. You do not need to Base64 encode it.
The Detailed Explanation:
Here is why that tooltip is confusing and technically incorrect:
Leftover Text (A Typo): The 3x-ui developers recently added this field to the web interface so the panel could automatically inject the hash into vless:// share links (saving you from having to manually type it into your client). However, the developer likely copy-pasted that description from the old, now-removed Xray setting (pinnedPeerCertificateChainSha256), which did require Base64 encoding.
Xray-core Expects Hex: As you learned earlier, the modern pinnedPeerCertSha256 parameter in Xray-core strictly expects a Hex string (without colons).
Clients Expect Hex: When your client app (like v2rayN, Nekobox, or V2rayA) reads the share link generated by 3x-ui, it expects to see a Hex string. If you put a Base64 string into the panel, the panel will generate a share link with a Base64 string, and your client will likely fail to connect because it won't know how to read it.
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.2.6
Xray-core version
26.6.1
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?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 2, 2026):
Thanks for the detailed and well-researched report — you are correct.
Confirmed bug: The tooltip and placeholder text in the UI are misleading. In
web/translation/en-US.jsonbothpinnedPeerCertSha256TipandpinnedPeerCertSha256Placeholderrefer to "base64" encoding, but that description is inaccurate for the normal user workflow.What the code actually does:
The internal
decodeCertPinhelper (web/service/node.go) accepts both formats — it tries hex (with optional colons, theopenssl -fingerprintstyle) first, and only falls back to base64 if hex decoding fails. For the share-linkpinSHA256/pcsparameters the value is forwarded as-is, so using a hex string is what virtually all clients (v2rayN, Nekobox, V2rayA, …) will expect.Fix needed: Update the tooltip and placeholder in the translation files to make clear that a plain hex fingerprint (e.g.
e8e2d3...) is the standard input, and that base64 is also accepted. The old description was indeed copied from the retiredpinnedPeerCertificateChainSha256field that required base64 — this one does not.A PR correcting the translation strings would be very welcome.
@MHSanaei commented on GitHub (Jun 2, 2026):
Fixed. The tooltip and placeholder were inaccurate for this field.
xray-core hex-decodes
pinnedPeerCertSha256(hex.DecodeString(strings.ReplaceAll(v, ":", ""))), and the panel forwards the field value as-is into share links and the JSON subscription, so clients hex-decode it too. Hex is the correct input here (e.g.e8e2d3…).One clarification to the earlier triage: base64 is not accepted for this inbound field —
decodeCertPin(which tolerates both hex and base64) is only on the Nodes path, not here. So the hint now says hex only, to avoid trading one misleading tooltip for another.Changes:
btoa) — an unusable pin — now emits hex.