Skip to content

Commit

Permalink
fix(tls): skip invalid system certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe authored Mar 8, 2024
1 parent 84d753f commit 1c393af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ pub fn tls_connector(
// Load system certificates and add them to the root store
let certs = rustls_native_certs::load_native_certs().with_context(|| "Cannot load system certificates")?;
for cert in certs {
root_store.add(&Certificate(cert.as_ref().to_vec()))?;
if let Err(err) = root_store.add(&Certificate(cert.as_ref().to_vec())) {
warn!("cannot load a system certificate: {:?}", err);
continue
}
}

let mut config = ClientConfig::builder()
Expand Down

0 comments on commit 1c393af

Please sign in to comment.