Skip to content

fix(comm): require TLS 1.3 minimum for websocket p2p client connections - #1631

Merged
mbrandenburger merged 2 commits into
mainfrom
p2p-websocket-tls13
Aug 4, 2026
Merged

fix(comm): require TLS 1.3 minimum for websocket p2p client connections#1631
mbrandenburger merged 2 commits into
mainfrom
p2p-websocket-tls13

Conversation

@adecaro

@adecaro adecaro commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The websocket P2P server TLS config already pinned MinVersion: tls.VersionTLS13, but the client config still allowed negotiating down to tls.VersionTLS12. This aligns the client with the server so both sides of the mTLS handshake reject anything below TLS 1.3.
  • Updates the ws package test fixtures (multiplexed_provider_test.go) that also allowed TLS 1.2 as a minimum, for consistency with the enforced policy.
  • Documents the TLS 1.3-only guarantee in docs/platform/view/services/comm/websocket.md.

Fixes #1630

Test plan

  • go build ./platform/view/services/comm/host/websocket/...
  • go vet ./platform/view/services/comm/host/websocket/...
  • go test ./platform/view/services/comm/host/websocket/... (both websocket and websocket/ws packages pass)

@adecaro adecaro added this to the 26Q3 milestone Jul 31, 2026
@adecaro adecaro added bug Something isn't working node-p2p comm labels Jul 31, 2026
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

Hey @adecaro 👋 thanks for the PR!
I'm your friendly PR Helper Bot 🤖 and I'll be riding shotgun on this one, keeping track of your PR's status to help you get it approved and merged.

This comment updates automatically as you push changes -- think of it as your PR's live scoreboard!
Here's the latest:


PR Checks

DCO Sign-off -- All commits have valid sign-offs. Nice work!


GPG Signature -- Heads up! The following commits don't have a verified GPG signature:

  • 22b152b fix(comm): require TLS 1.3 minimum for websocket p2p client connections
  • eeecbfd test(comm): add negative handshake test for TLS 1.2 client rejection

You'll need to sign your commits with GPG (e.g. git commit -S). See the Signing Guide for a step-by-step walkthrough.


Merge Conflicts -- No merge conflicts detected. Smooth sailing!


Issue Link -- Linked to #1630 (assigned to you).


All checks must pass before this PR can be reviewed. You've got this!

@github-actions github-actions Bot added the status: needs revision The pull request requires changes from the author before it can be reviewed or merged label Jul 31, 2026

@mbrandenburger mbrandenburger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @adecaro for this PR.

Comment on lines 446 to +447
clientTLSConfig := &tls.Config{
MinVersion: tls.VersionTLS12,
MinVersion: tls.VersionTLS13,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should add a negative handshake test where the client indeed tries to connect with TLS12 and gets rejected. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call — added TestRejectsTLS12ClientHandshake in 88a879c, which forces the client's MinVersion/MaxVersion down to TLS 1.2 and asserts the handshake against the server fails with protocol version not supported, the server-side callback is never invoked, and no client connection is registered.

adecaro added a commit that referenced this pull request Aug 4, 2026
Addresses review feedback on #1631: verify that a client which only
offers TLS 1.2 fails the handshake against the websocket p2p server,
which now pins MinVersion to TLS 1.3 on both sides.

Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
@adecaro
adecaro requested a review from mbrandenburger August 4, 2026 12:31
adecaro added a commit that referenced this pull request Aug 4, 2026
Addresses review feedback on #1631: verify that a client which only
offers TLS 1.2 fails the handshake against the websocket p2p server,
which now pins MinVersion to TLS 1.3 on both sides.

Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
@adecaro
adecaro force-pushed the p2p-websocket-tls13 branch from 88a879c to b2c81dc Compare August 4, 2026 12:31
adecaro added 2 commits August 4, 2026 15:59
The websocket server TLS config already pinned MinVersion to TLS 1.3,
but the client config still allowed negotiating down to TLS 1.2. Align
the client with the server so both sides of the mTLS handshake reject
anything below TLS 1.3, and update the docs and test fixtures to match.

Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
Addresses review feedback on #1631: verify that a client which only
offers TLS 1.2 fails the handshake against the websocket p2p server,
which now pins MinVersion to TLS 1.3 on both sides.

Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
@mergify

mergify Bot commented Aug 4, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mbrandenburger
mbrandenburger merged commit ad478e9 into main Aug 4, 2026
54 of 55 checks passed
@mbrandenburger
mbrandenburger deleted the p2p-websocket-tls13 branch August 4, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working comm node-p2p status: needs revision The pull request requires changes from the author before it can be reviewed or merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

websocket p2p client TLS config allows negotiating down to TLS 1.2

2 participants