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::*;
60
60
pub fn tls_config ( ) -> ClientConfig {
61
61
rustls:: ClientConfig :: builder ( )
62
62
. with_safe_defaults ( )
63
- . with_custom_certificate_verifier ( verifier_for_testing ( ) )
63
+ . with_custom_certificate_verifier ( Arc :: new ( Verifier :: new ( ) ) )
64
64
. with_no_client_auth ( )
65
65
}
66
66
67
- /// Exposed for test usage. Don't use this, use [tls_config] instead .
67
+ /// Exposed for debugging certificate issues with standalone tools .
68
68
///
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.
75
70
#[ cfg( feature = "dbg" ) ]
76
71
pub fn verifier_for_dbg ( root : & [ u8 ] ) -> Arc < dyn rustls:: client:: ServerCertVerifier > {
77
72
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";
82
82
#[ cfg( any( test, feature = "ffi-testing" ) ) ]
83
83
#[ cfg_attr( feature = "ffi-testing" , allow( dead_code) ) ]
84
84
pub ( super ) fn verification_without_mock_root ( ) {
85
- let verifier = crate :: verifier_for_testing ( ) ;
85
+ let verifier = Verifier :: new ( ) ;
86
86
87
87
let server_name = rustls:: client:: ServerName :: try_from ( EXAMPLE_COM ) . unwrap ( ) ;
88
88
let end_entity = rustls:: Certificate ( ROOT1_INT1_EXAMPLE_COM_GOOD . to_vec ( ) ) ;
Original file line number Diff line number Diff line change 42
42
//! Thus we don't expect these tests to be flaky w.r.t. that, except for
43
43
//! potentially poor performance.
44
44
use 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 } ;
47
47
use std:: convert:: TryFrom ;
48
48
49
49
// This is the certificate chain presented by one server for
@@ -124,7 +124,7 @@ macro_rules! no_error {
124
124
fn real_world_test < E : std:: error:: Error > ( test_case : & TestCase < E > ) {
125
125
log:: info!( "verifying {:?}" , test_case. expected_result) ;
126
126
127
- let verifier = crate :: verifier_for_testing ( ) ;
127
+ let verifier = Verifier :: new ( ) ;
128
128
129
129
let mut chain = test_case
130
130
. chain
You can’t perform that action at this time.
0 commit comments