rust-libp2p icon indicating copy to clipboard operation
rust-libp2p copied to clipboard

feat: support SNI multiaddrs in WebSocket transport

Open rose2221 opened this issue 7 months ago • 1 comments

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

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

rose2221 avatar May 31 '25 15:05 rose2221

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!

rose2221 avatar Jun 09 '25 07:06 rose2221

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!

following up on this PR:- @elenaf9 @jxs @dariusc93

rose2221 avatar Jun 25 '25 12:06 rose2221

Looking to integrate rust-libp2p but this is one of the prerequisites, does this need further review for merge?

Faolain avatar Jul 10 '25 08:07 Faolain

Looking to integrate rust-libp2p but this is one of the prerequisites, does this need further review for merge?

Sorry, I didn't have much capacity for rust-libp2p lately. Help, especially with reviews, would be much appreciated!

I hope I'll have more time again in the near future. I know that there are some PRs that have been waiting for quite some time.

elenaf9 avatar Jul 12 '25 20:07 elenaf9