[GH-ISSUE #4793] [Bug]: Misleading tooltip for Pinned Peer Cert SHA-256 #3330

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

Originally created by @my-johnlee on GitHub (Jun 2, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4793

Describe the bug

Image

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

  • 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 @my-johnlee on GitHub (Jun 2, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4793 ### Describe the bug <img width="248" height="139" alt="Image" src="https://github.com/user-attachments/assets/b4cdcc4d-7ef4-4d55-835c-36e63442dc02" /> 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 ```shell ``` ### 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 - [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:31:41 +07:00
Author
Owner

@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.json both pinnedPeerCertSha256Tip and pinnedPeerCertSha256Placeholder refer to "base64" encoding, but that description is inaccurate for the normal user workflow.

What the code actually does:

The internal decodeCertPin helper (web/service/node.go) accepts both formats — it tries hex (with optional colons, the openssl -fingerprint style) first, and only falls back to base64 if hex decoding fails. For the share-link pinSHA256 / pcs parameters 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 retired pinnedPeerCertificateChainSha256 field that required base64 — this one does not.

A PR correcting the translation strings would be very welcome.

<!-- gh-comment-id:4598603397 --> @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.json` both `pinnedPeerCertSha256Tip` and `pinnedPeerCertSha256Placeholder` refer to "base64" encoding, but that description is inaccurate for the normal user workflow. **What the code actually does:** The internal `decodeCertPin` helper ([`web/service/node.go`](../blob/main/web/service/node.go)) accepts **both** formats — it tries hex (with optional colons, the `openssl -fingerprint` style) first, and only falls back to base64 if hex decoding fails. For the share-link `pinSHA256` / `pcs` parameters 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 retired `pinnedPeerCertificateChainSha256` field that required base64 — this one does not. A PR correcting the translation strings would be very welcome.
Author
Owner

@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:

  • Tooltip + placeholder corrected to hex across all 13 locales.
  • Fixed the "Generate random hash" button, which was emitting base64 (via btoa) — an unusable pin — now emits hex.
<!-- gh-comment-id:4602740614 --> @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: - Tooltip + placeholder corrected to hex across all 13 locales. - Fixed the "Generate random hash" button, which was emitting base64 (via `btoa`) — an unusable pin — now emits hex.
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#3330
No description provided.