@@ -12,7 +12,7 @@ mod client {
1212 } ;
1313
1414 use rustls:: {
15- ClientConfig , ClientConnection , RootCertStore ,
15+ ClientConfig , RootCertStore ,
1616 client:: { ClientCredentialResolver , CredentialRequest } ,
1717 crypto:: { Credentials , Identity , SelectedCredential } ,
1818 enums:: CertificateType ,
@@ -64,12 +64,13 @@ mod client {
6464 let mut root_store = RootCertStore :: empty ( ) ;
6565 root_store. add ( ca_cert. as_der ( ) . into ( ) ) ?;
6666
67- let client_config = ClientConfig :: builder ( Arc :: new ( rustls_aws_lc_rs :: DEFAULT_PROVIDER ) )
68- . with_root_certificates ( root_store )
69- . with_client_credential_resolver ( Arc :: new ( ClientCertResolver ( store , "rustls-client" . to_string ( ) ) ) ) ? ;
70-
71- let mut connection = ClientConnection :: new ( Arc :: new ( client_config ) , "rustls-server" . try_into ( ) ? ) ? ;
67+ let client_config = Arc :: new (
68+ ClientConfig :: builder ( Arc :: new ( rustls_aws_lc_rs :: DEFAULT_PROVIDER ) )
69+ . with_root_certificates ( root_store )
70+ . with_client_credential_resolver ( Arc :: new ( ClientCertResolver ( store , "rustls-client" . to_string ( ) ) ) ) ? ,
71+ ) ;
7272
73+ let mut connection = client_config. connect ( "rustls-server" . try_into ( ) ?) . build ( ) ?;
7374 let mut client = TcpStream :: connect ( format ! ( "localhost:{port}" ) ) ?;
7475
7576 let mut tls_stream = Stream :: new ( & mut connection, & mut client) ;
0 commit comments