Skip to content

Comments

Change PinnedPeerCertSha256 from array to tilde-separated string#5507

Merged
RPRX merged 5 commits intocert-pinfrom
copilot/sub-pr-5154
Jan 9, 2026
Merged

Change PinnedPeerCertSha256 from array to tilde-separated string#5507
RPRX merged 5 commits intocert-pinfrom
copilot/sub-pr-5154

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

Changed the PinnedPeerCertSha256 configuration field from a string array to a single string accepting multiple SHA-256 hashes separated by ~.

Changes

  • Configuration struct: Changed field type from *[]string to string in infra/conf/transport_internet.go
  • JSON tag: Removed trailing space from JSON tag (pinnedPeerCertSha256)
  • Parsing logic: Split input on ~ separator, trim whitespace, skip empty values

Usage

{
  "tlsSettings": {
    "pinnedPeerCertSha256": "AE243D668EC9C7F74A0DCD1AD21C6676B4EFE30C39728934B362093AF886BF77"
  }
}

Multiple hashes:

{
  "tlsSettings": {
    "pinnedPeerCertSha256": "hash1~hash2~hash3"
  }
}

This format simplifies share link encoding and UI implementation while maintaining support for multiple pinned certificates. The tilde separator doesn't require URL encoding and is visually distinct, making it ideal for share links and configuration files.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Jan 8, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 1.1.1.1
    • Triggering command: REDACTED, pid is -1 (packet block)
  • cloudflare.com
    • Triggering command: /tmp/go-build2811748829/b001/tls.test /tmp/go-build2811748829/b001/tls.test -test.testlogfile=/tmp/go-build2811748829/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true v0.0.0-202509042-errorsas 061270/b108/ ux-amd64/pkg/tool/linux_amd64/vet -I status mpile ux-amd64/pkg/too-buildtags 0612�� [email protected]/http3-errorsas [email protected]/http3-ifaceassert ux-amd64/pkg/tool/linux_amd64/compile /tmp/go-build247git -imultiarch x86_64-linux-gnucopilot/sub-pr-5154 ux-amd64/pkg/tool/linux_amd64/compile (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Refactor certificate pin logic Change PinnedPeerCertSha256 from array to pipe-separated string Jan 8, 2026
Copilot AI requested a review from RPRX January 8, 2026 23:44
@RPRX
Copy link
Member

RPRX commented Jan 8, 2026

@copilot json:"pinnedPeerCertSha256 " 去掉后面的空格,使用 string 而不是 *string

Copy link
Contributor Author

Copilot AI commented Jan 8, 2026

@copilot json:"pinnedPeerCertSha256 " 去掉后面的空格,使用 string 而不是 *string

Done! Changed from *string to string and removed the trailing space in the JSON tag. All TLS pinning tests pass successfully. (Commit: 7ee4bd4)

@RPRX
Copy link
Member

RPRX commented Jan 8, 2026

@copilot 把分隔符 | 替换为 _

@RPRX
Copy link
Member

RPRX commented Jan 8, 2026

@copilot 算了还是用 ~

Copy link
Contributor Author

Copilot AI commented Jan 8, 2026

@copilot 把分隔符 | 替换为 _

Done! Changed the separator from | to _. All TLS pinning tests pass successfully. (Commit: 9e37c29)

Copilot AI changed the title Change PinnedPeerCertSha256 from array to pipe-separated string Change PinnedPeerCertSha256 from array to underscore-separated string Jan 8, 2026
Copy link
Contributor Author

Copilot AI commented Jan 8, 2026

@copilot 算了还是用 ~

Done! Changed the separator to ~. All TLS pinning tests pass successfully. (Commit: 5a66c40)

Copilot AI changed the title Change PinnedPeerCertSha256 from array to underscore-separated string Change PinnedPeerCertSha256 from array to tilde-separated string Jan 9, 2026
@RPRX RPRX marked this pull request as ready for review January 9, 2026 00:03
@RPRX RPRX merged commit dde96f7 into cert-pin Jan 9, 2026
RPRX added a commit that referenced this pull request Jan 9, 2026
…ChainSha256` and `pinnedPeerCertificatePublicKeySha256` (#5154)

Usage: #5507

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: RPRX <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants