File tree 1 file changed +8
-10
lines changed
1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -72,20 +72,18 @@ pub async fn connect_client(
72
72
let endpoint =
73
73
quinn:: Endpoint :: client ( SocketAddr :: new ( IpAddr :: V4 ( Ipv4Addr :: LOCALHOST ) , 0 ) ) . unwrap ( ) ;
74
74
75
- let secret_key = iroh:: SecretKey :: generate ( & mut rand:: rngs:: OsRng ) ;
76
-
77
75
let mut roots = RootCertStore :: empty ( ) ;
78
76
roots. add ( server_cert) ?;
79
77
80
- let client_config = iroh:: TlsAuthentication :: X509 . make_client_config (
81
- & secret_key,
82
- None ,
83
- vec ! [ ALPN . to_vec( ) ] ,
84
- false ,
85
- ) ?;
78
+ let provider = rustls:: crypto:: ring:: default_provider ( ) ;
79
+
80
+ let crypto = rustls:: ClientConfig :: builder_with_provider ( provider. into ( ) )
81
+ . with_protocol_versions ( & [ & rustls:: version:: TLS13 ] )
82
+ . unwrap ( )
83
+ . with_root_certificates ( roots)
84
+ . with_no_client_auth ( ) ;
86
85
87
- let mut client_config =
88
- quinn:: ClientConfig :: new ( Arc :: new ( QuicClientConfig :: try_from ( client_config) ?) ) ;
86
+ let mut client_config = quinn:: ClientConfig :: new ( Arc :: new ( QuicClientConfig :: try_from ( crypto) ?) ) ;
89
87
client_config. transport_config ( Arc :: new ( transport_config ( opt. max_streams , opt. initial_mtu ) ) ) ;
90
88
91
89
let connection = endpoint
You can’t perform that action at this time.
0 commit comments