feat: Implementation of AutoTLS#6470
Open
dariusc93 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.directvia p2p-forge broker so browsers can dial the node over WSS.This PR makes changes to
libp2p-websocketto addtls::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
noneif no AI was used): noneAttestation (required):
Notes & open questions
rustls::server::ResolvesServerCertto the public API, and honestly would love to hear thoughts and opinions around that.CertStoretrait 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)Change checklist