Skip to content

feat: support SNI multiaddrs in WebSocket transport #6041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rose2221
Copy link
Contributor

@rose2221 rose2221 commented May 31, 2025

Description

Adds support for WebSocket dialing with multiaddrs of the form:

/ip4/…/tcp/…/tls/sni/<hostname>/ws

This enables rust-libp2p nodes to connect to WSS peers using SNI-based addressing, as introduced in the libp2p specs for autotls support.

Motivation

Services like autotls allow nodes to obtain certificates matching their Peer ID. This PR enables rust-libp2p to dial these nodes using canonical SNI multiaddrs (e.g. /tls/sni/<peerid>.libp2p.direct/ws), which were previously unsupported.

Related

Fixes #5814
Spec: libp2p websocket spec

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@rose2221 rose2221 changed the title feat(websocket): support SNI multiaddrs in WebSocket transport feat: support SNI multiaddrs in WebSocket transport May 31, 2025
@rose2221
Copy link
Contributor Author

rose2221 commented Jun 9, 2025

Hi @elenaf9 , just following up on this PR — let me know if there’s any further feedback or if it looks good to you. Thanks!

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.

wss: sni addrs support
1 participant