@@ -210,9 +210,8 @@ pub fn create_quinn_client(
210
210
alpn_protocols : Vec < Vec < u8 > > ,
211
211
keylog : bool ,
212
212
) -> anyhow:: Result < iroh_quinn:: Endpoint > {
213
- let secret_key = iroh:: key:: SecretKey :: generate ( ) ;
214
- let tls_client_config =
215
- iroh:: tls:: make_client_config ( & secret_key, None , alpn_protocols, keylog) ?;
213
+ let secret_key = iroh:: SecretKey :: generate ( rand:: thread_rng ( ) ) ;
214
+ let tls_client_config = tls:: make_client_config ( & secret_key, None , alpn_protocols, keylog) ?;
216
215
let mut client_config = iroh_quinn:: ClientConfig :: new ( Arc :: new ( tls_client_config) ) ;
217
216
let mut endpoint = iroh_quinn:: Endpoint :: client ( bind_addr) ?;
218
217
let mut transport_config = iroh_quinn:: TransportConfig :: default ( ) ;
@@ -223,7 +222,7 @@ pub fn create_quinn_client(
223
222
}
224
223
225
224
async fn create_endpoint (
226
- key : iroh:: key :: SecretKey ,
225
+ key : iroh:: SecretKey ,
227
226
ipv4_addr : SocketAddrV4 ,
228
227
ipv6_addr : SocketAddrV6 ,
229
228
publish : bool ,
@@ -301,7 +300,7 @@ async fn connect_iroh(
301
300
// todo: uncomment once the connection problems are fixed
302
301
// for now, a random node id is more reliable.
303
302
// let key = load_secret_key(tracker_path(CLIENT_KEY)?).await?;
304
- let key = iroh:: key :: SecretKey :: generate ( ) ;
303
+ let key = iroh:: SecretKey :: generate ( rand :: thread_rng ( ) ) ;
305
304
let endpoint = create_endpoint ( key, local_ipv4_addr, local_ipv6_addr, false ) . await ?;
306
305
tracing:: info!( "trying to connect to tracker at {:?}" , tracker) ;
307
306
let connection = endpoint. connect ( tracker, ALPN ) . await ?;
0 commit comments