File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1231,9 +1231,12 @@ fn make_quic_endpoint(
12311231 quic_listen_port : u16 ,
12321232 firewall_mark : Option < u32 > ,
12331233) -> Result < quinn:: Endpoint , Box < dyn std:: error:: Error > > {
1234- // Install ring crypto provider for rustls
1235- rustls:: crypto:: CryptoProvider :: install_default ( rustls:: crypto:: ring:: default_provider ( ) )
1236- . expect ( "Crypto provider has not been installed yet" ) ;
1234+ // Install ring crypto provider for rustls (only if not already installed)
1235+ if rustls:: crypto:: CryptoProvider :: get_default ( ) . is_none ( ) {
1236+ rustls:: crypto:: CryptoProvider :: install_default ( rustls:: crypto:: ring:: default_provider ( ) )
1237+ . expect ( "Failed to install crypto provider" ) ;
1238+ }
1239+
12371240 // Generate self signed certificate certificate.
12381241 // TODO: sign with router keys
12391242 let cert = rcgen:: generate_simple_self_signed ( vec ! [ format!( "{router_id}" ) ] ) ?;
You can’t perform that action at this time.
0 commit comments