File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed
rustls-platform-verifier/src Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -60,18 +60,13 @@ pub use tests::ffi::*;
6060pub fn tls_config ( ) -> ClientConfig {
6161 rustls:: ClientConfig :: builder ( )
6262 . with_safe_defaults ( )
63- . with_custom_certificate_verifier ( verifier_for_testing ( ) )
63+ . with_custom_certificate_verifier ( Arc :: new ( Verifier :: new ( ) ) )
6464 . with_no_client_auth ( )
6565}
6666
67- /// Exposed for test usage. Don't use this, use [tls_config] instead .
67+ /// Exposed for debugging certificate issues with standalone tools .
6868///
69- /// This verifier must be exactly equivalent to the verifier used in the `ClientConfig` returned by [tls_config].
70- pub ( crate ) fn verifier_for_testing ( ) -> Arc < dyn rustls:: client:: ServerCertVerifier > {
71- Arc :: new ( Verifier :: new ( ) )
72- }
73-
74- /// Exposed for debugging customer certificate issues. Don't use this, use [tls_config] instead.
69+ /// This is not intended for production use, you should use [tls_config] instead.
7570#[ cfg( feature = "dbg" ) ]
7671pub fn verifier_for_dbg ( root : & [ u8 ] ) -> Arc < dyn rustls:: client:: ServerCertVerifier > {
7772 Arc :: new ( Verifier :: new_with_fake_root ( root) )
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ const LOCALHOST_IPV6: &str = "::1";
8282#[ cfg( any( test, feature = "ffi-testing" ) ) ]
8383#[ cfg_attr( feature = "ffi-testing" , allow( dead_code) ) ]
8484pub ( super ) fn verification_without_mock_root ( ) {
85- let verifier = crate :: verifier_for_testing ( ) ;
85+ let verifier = Verifier :: new ( ) ;
8686
8787 let server_name = rustls:: client:: ServerName :: try_from ( EXAMPLE_COM ) . unwrap ( ) ;
8888 let end_entity = rustls:: Certificate ( ROOT1_INT1_EXAMPLE_COM_GOOD . to_vec ( ) ) ;
Original file line number Diff line number Diff line change 4242//! Thus we don't expect these tests to be flaky w.r.t. that, except for
4343//! potentially poor performance.
4444use super :: TestCase ;
45- use crate :: tests:: assert_cert_error_eq;
46- use rustls:: { CertificateError , Error as TlsError } ;
45+ use crate :: { tests:: assert_cert_error_eq, Verifier } ;
46+ use rustls:: { client :: ServerCertVerifier , CertificateError , Error as TlsError } ;
4747use std:: convert:: TryFrom ;
4848
4949// This is the certificate chain presented by one server for
@@ -124,7 +124,7 @@ macro_rules! no_error {
124124fn real_world_test < E : std:: error:: Error > ( test_case : & TestCase < E > ) {
125125 log:: info!( "verifying {:?}" , test_case. expected_result) ;
126126
127- let verifier = crate :: verifier_for_testing ( ) ;
127+ let verifier = Verifier :: new ( ) ;
128128
129129 let mut chain = test_case
130130 . chain
You can’t perform that action at this time.
0 commit comments