Skip to content

Commit 85cf196

Browse files
committed
Forward errors from parsing extra roots
1 parent 1589a63 commit 85cf196

File tree

1 file changed

+4
-12
lines changed
  • rustls-platform-verifier/src/verification

1 file changed

+4
-12
lines changed

rustls-platform-verifier/src/verification/others.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,18 +78,10 @@ impl Verifier {
7878
}
7979
}
8080

81-
let mut num_extra_roots = 0;
82-
let (added, ignored) =
83-
root_store.add_parsable_certificates(extra_roots.into_iter().inspect(|_| {
84-
num_extra_roots += 1;
85-
}));
86-
87-
if num_extra_roots > 0 {
88-
if ignored > 0 {
89-
log::warn!("{ignored} extra CA root certificates were ignored due to errors");
90-
} else {
91-
log::debug!("Loaded {added} CA root certificates from extra roots");
92-
}
81+
// While we ignore invalid certificates from the system, we forward errors from
82+
// parsing the extra roots to the caller.
83+
for cert in extra_roots {
84+
root_store.add(cert)?;
9385
}
9486

9587
#[cfg(all(

0 commit comments

Comments
 (0)