[GH-ISSUE #5401] [Bug]: pinnedPeerCertSha256 #3780

Closed
opened 2026-10-31 20:34:54 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @andyplop9 on GitHub (Jun 17, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5401

Describe the bug

In JSON sub for pinnedPeerCertSha256, it gives it in brackets, and in v2ray clients, it can't be imported. Only with "" is it possible.

How to reproduce the problem

Copy JSON Sub

Expected behavior

No response

Actual behavior

No response

Relevant logs


Screenshots

No response

3x-ui version

3.3.1

Xray-core version

No response

How did you install 3x-ui?

Docker / Docker Compose

Operating system

Ubuntu 24.04

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 @andyplop9 on GitHub (Jun 17, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5401 ### Describe the bug In JSON sub for pinnedPeerCertSha256, it gives it in brackets, and in v2ray clients, it can't be imported. Only with "" is it possible. ### How to reproduce the problem Copy JSON Sub ### Expected behavior _No response_ ### Actual behavior _No response_ ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.3.1 ### Xray-core version _No response_ ### How did you install 3x-ui? Docker / Docker Compose ### Operating system Ubuntu 24.04 ### 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:34:54 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jun 17, 2026):

The JSON subscription service (internal/sub/json_service.go, lines 291–293) currently emits pinnedPeerCertSha256 as a JSON array:

"pinnedPeerCertSha256": ["<hash>"]

This matches the xray-core outbound TLS config format, which declares that field as []string. Clients whose JSON parser is backed by xray-core should accept the array form without issue.

For the report to be actionable, the following details are needed:

  1. Which client application is failing to import the JSON subscription, and its version (e.g. V2rayN 7.x, Nekobox 1.x, etc.).
  2. The raw JSON snippet from the subscription output that triggers the error — specifically the tlsSettings block containing pinnedPeerCertSha256.
  3. The error message or failure mode the client produces (import dialog error, crash log, silent failure to connect).
  4. Inbound protocol and transport for the affected inbound (e.g. VLESS + TLS, VMess + WebSocket + TLS).

Note: this is a separate issue from #4818, which concerned Hysteria2 share-link pinSHA256 encoding (base64 vs. hex) and was resolved in commit ac67c522. The JSON subscription path (json_service.go) is a distinct code path.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4725443420 --> @github-actions[bot] commented on GitHub (Jun 17, 2026): The JSON subscription service (`internal/sub/json_service.go`, lines 291–293) currently emits `pinnedPeerCertSha256` as a JSON array: ```json "pinnedPeerCertSha256": ["<hash>"] ``` This matches the xray-core outbound TLS config format, which declares that field as `[]string`. Clients whose JSON parser is backed by xray-core should accept the array form without issue. For the report to be actionable, the following details are needed: 1. **Which client application** is failing to import the JSON subscription, and its version (e.g. V2rayN 7.x, Nekobox 1.x, etc.). 2. **The raw JSON snippet** from the subscription output that triggers the error — specifically the `tlsSettings` block containing `pinnedPeerCertSha256`. 3. **The error message or failure mode** the client produces (import dialog error, crash log, silent failure to connect). 4. **Inbound protocol and transport** for the affected inbound (e.g. VLESS + TLS, VMess + WebSocket + TLS). Note: this is a separate issue from #4818, which concerned Hysteria2 share-link `pinSHA256` encoding (base64 vs. hex) and was resolved in commit `ac67c522`. The JSON subscription path (`json_service.go`) is a distinct code path. *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@andyplop9 commented on GitHub (Jun 17, 2026):

https://github.com/XTLS/Xray-core/pull/5507
github.com/XTLS/Xray-core@dde96f7
I found these two
I hope it helps

I believe it is comma separated(github.com/XTLS/Xray-core@2c92339f95)

The actual diff in infra/conf/transport_internet.go shows the before and after side by side. The old code being removed:

config.PinnedPeerCertSha256 = [][]byte{}
// Split by tilde separator
hashes := strings.Split(c.PinnedPeerCertSha256, "~")
for _, v := range hashes {

Replaced with the new code being added:

for v := range strings.SplitSeq(c.PinnedPeerCertSha256, ",") {

<!-- gh-comment-id:4725516415 --> @andyplop9 commented on GitHub (Jun 17, 2026): https://github.com/XTLS/Xray-core/pull/5507 https://github.com/XTLS/Xray-core/commit/dde96f7 I found these two I hope it helps I believe it is comma separated(https://github.com/XTLS/Xray-core/commit/2c92339f95fe9aa493b6ae51d3b07017a44c4014) The actual diff in infra/conf/transport_internet.go shows the before and after side by side. The old code being removed: config.PinnedPeerCertSha256 = [][]byte{} // Split by tilde separator hashes := strings.Split(c.PinnedPeerCertSha256, "~") for _, v := range hashes { Replaced with the new code being added: for v := range strings.SplitSeq(c.PinnedPeerCertSha256, ",") {
Author
Owner

@islamsadril770-ux commented on GitHub (Aug 19, 2026):

<!-- gh-comment-id:5348580560 --> @islamsadril770-ux commented on GitHub (Aug 19, 2026): [](url)
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#3780
No description provided.