File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
rustls-platform-verifier/src Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ pub(super) fn verification_without_mock_root() {
116116 . iter ( )
117117 . cloned ( )
118118 . collect ( ) ,
119- ) ;
119+ )
120+ . unwrap ( ) ;
120121
121122 #[ cfg( not( target_os = "freebsd" ) ) ]
122123 let verifier = Verifier :: new ( ) ;
@@ -337,7 +338,7 @@ fn test_with_mock_root<E: std::error::Error + PartialEq + 'static>(
337338 let verifier = match root_src {
338339 Roots :: OnlyExtra => Verifier :: new_with_fake_root ( ROOT1 ) , // TODO: time
339340 #[ cfg( not( target_os = "android" ) ) ]
340- Roots :: ExtraAndPlatform => Verifier :: new_with_extra_roots ( vec ! [ ROOT1 . into( ) ] ) ,
341+ Roots :: ExtraAndPlatform => Verifier :: new_with_extra_roots ( vec ! [ ROOT1 . into( ) ] ) . unwrap ( ) ,
341342 } ;
342343 let mut chain = test_case
343344 . chain
Original file line number Diff line number Diff line change @@ -133,7 +133,8 @@ fn real_world_test<E: std::error::Error>(test_case: &TestCase<E>) {
133133 . iter ( )
134134 . cloned ( )
135135 . collect ( ) ,
136- ) ;
136+ )
137+ . unwrap ( ) ;
137138
138139 #[ cfg( not( target_os = "freebsd" ) ) ]
139140 let verifier = Verifier :: new ( ) ;
Original file line number Diff line number Diff line change @@ -53,8 +53,10 @@ impl Verifier {
5353 /// Creates a new verifier whose certificate validation is provided by
5454 /// WebPKI, using root certificates provided by the platform and augmented by
5555 /// the provided extra root certificates.
56- pub fn new_with_extra_roots ( roots : Vec < pki_types:: CertificateDer < ' static > > ) -> Self {
57- Self {
56+ pub fn new_with_extra_roots (
57+ roots : Vec < pki_types:: CertificateDer < ' static > > ,
58+ ) -> Result < Self , TlsError > {
59+ Ok ( Self {
5860 inner : OnceCell :: new ( ) ,
5961 extra_roots : roots
6062 . into_iter ( )
@@ -66,7 +68,7 @@ impl Verifier {
6668 #[ cfg( any( test, feature = "ffi-testing" , feature = "dbg" ) ) ]
6769 test_only_root_ca_override : None ,
6870 crypto_provider : OnceCell :: new ( ) ,
69- }
71+ } )
7072 }
7173
7274 /// Creates a test-only TLS certificate verifier which trusts our fake root CA cert.
You can’t perform that action at this time.
0 commit comments