File tree 3 files changed +10
-6
lines changed
rustls-platform-verifier/src
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() {
116
116
. iter ( )
117
117
. cloned ( )
118
118
. collect ( ) ,
119
- ) ;
119
+ )
120
+ . unwrap ( ) ;
120
121
121
122
#[ cfg( not( target_os = "freebsd" ) ) ]
122
123
let verifier = Verifier :: new ( ) ;
@@ -337,7 +338,7 @@ fn test_with_mock_root<E: std::error::Error + PartialEq + 'static>(
337
338
let verifier = match root_src {
338
339
Roots :: OnlyExtra => Verifier :: new_with_fake_root ( ROOT1 ) , // TODO: time
339
340
#[ 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 ( ) ,
341
342
} ;
342
343
let mut chain = test_case
343
344
. 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>) {
133
133
. iter ( )
134
134
. cloned ( )
135
135
. collect ( ) ,
136
- ) ;
136
+ )
137
+ . unwrap ( ) ;
137
138
138
139
#[ cfg( not( target_os = "freebsd" ) ) ]
139
140
let verifier = Verifier :: new ( ) ;
Original file line number Diff line number Diff line change @@ -53,8 +53,10 @@ impl Verifier {
53
53
/// Creates a new verifier whose certificate validation is provided by
54
54
/// WebPKI, using root certificates provided by the platform and augmented by
55
55
/// 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 {
58
60
inner : OnceCell :: new ( ) ,
59
61
extra_roots : roots
60
62
. into_iter ( )
@@ -66,7 +68,7 @@ impl Verifier {
66
68
#[ cfg( any( test, feature = "ffi-testing" , feature = "dbg" ) ) ]
67
69
test_only_root_ca_override : None ,
68
70
crypto_provider : OnceCell :: new ( ) ,
69
- }
71
+ } )
70
72
}
71
73
72
74
/// 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