feat: support SNI multiaddrs in WebSocket transport
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
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!
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
Looking to integrate rust-libp2p but this is one of the prerequisites, does this need further review for merge?
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.