From 36d7961b20a46c1753634a8b51a5b91bc9addcf9 Mon Sep 17 00:00:00 2001 From: Lee Smet Date: Wed, 8 May 2024 12:40:42 +0200 Subject: [PATCH] Install ring crypto provider for quinn endpoint A default crypto provider in installed before creating the quinn endpoint, as that is needed for rustls (part of the endpoint tls config). This also allows us to get the default provider when connecting to a remote quic endpoint. Signed-off-by: Lee Smet --- mycelium/src/peer_manager.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mycelium/src/peer_manager.rs b/mycelium/src/peer_manager.rs index 4fcb69a..76bc5c6 100644 --- a/mycelium/src/peer_manager.rs +++ b/mycelium/src/peer_manager.rs @@ -1062,6 +1062,9 @@ fn make_quic_endpoint( quic_listen_port: u16, firewall_mark: Option, ) -> Result> { + // Install ring crypto provider for rustls + rustls::crypto::CryptoProvider::install_default(rustls::crypto::ring::default_provider()) + .expect("Crypto provider has not been installed yet"); // Generate self signed certificate certificate. // TODO: sign with router keys let cert = rcgen::generate_simple_self_signed(vec![format!("{router_id}")])?;