Skip to content

feat: Implementation of AutoTLS#6470

Open
dariusc93 wants to merge 2 commits into
libp2p:masterfrom
dariusc93:feat/autotls-ws
Open

feat: Implementation of AutoTLS#6470
dariusc93 wants to merge 2 commits into
libp2p:masterfrom
dariusc93:feat/autotls-ws

Conversation

@dariusc93
Copy link
Copy Markdown
Member

Description

This PR introduces AutoTLS implementation, similar to what is done with go-libp2p and js-libp2p, which will obtain and renew a certificate for <ip>.<peer_id>.libp2p.direct via p2p-forge broker so browsers can dial the node over WSS.

This PR makes changes to libp2p-websocket to add tls::Config::new_with_server_cert_resolver, which is used to resolve server certificates dynamically, allowing the served certificate to be swapped at runtime without rerunning the transport.

AI Assistance Disclosure

Tools used (required — write none if no AI was used): none

Attestation (required):

  • I have read every line of this diff, understand what it does, and can explain it in review.

Notes & open questions

  • I welcome feedback, especially with the libp2p-websocket change since I am not exactly happy about exposing rustls::server::ResolvesServerCert to the public API, and honestly would love to hear thoughts and opinions around that.
  • I do have CertStore trait with it returning futures, with the idea of allowing file IO, maybe accessing database, or just using the memory impl (though doing this in production with a node that restarts a lot is not ideal). Thoughts on this would be nice since I could not decide if I should leave it async or make it sync (though each one may come with pros and cons)
  • Example that is provided does explicitly looks for a public ip address, but one could probably pair it with upnp and have it look for external addresses as well that is not relayed or rely on autonat.

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

@dariusc93 dariusc93 changed the title feat(tis): base implementation of AutoTLS feat: Implementation of AutoTLS Jun 4, 2026
@dariusc93 dariusc93 requested review from elenaf9 and jxs June 4, 2026 22:18
@dariusc93 dariusc93 marked this pull request as ready for review June 5, 2026 00:16
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.

1 participant