Skip to content

Commit

Permalink
switch to using add_parsable_certs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthme committed Nov 11, 2024
1 parent d8e8d01 commit 26de8be
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions crates/tx5-signal/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,13 @@ fn priv_system_tls() -> Arc<rustls::ClientConfig> {
target_os = "linux",
target_os = "macos"
))]
for cert in rustls_native_certs::load_native_certs()
.expect("failed to load system tls certs")
{
match roots
.add(&rustls::Certificate(cert.0)) {
Ok(_) => (),
Err(_) => roots.add_server_trust_anchors(
webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|a| {
rustls::OwnedTrustAnchor::from_subject_spki_name_constraints(
a.subject.to_vec(),
a.spki.to_vec(),
a.name_constraints.map(|c| c.to_vec()),
)
}),
)
}
let certs = rustls_native_certs::load_native_certs()
.expect("failed to load system tls certs")
.into_iter()
.map(|c| c.0)
.collect::<Vec<Vec<u8>>>();
roots.add_parsable_certificates(certs.as_ref());
}

Arc::new(
Expand Down

0 comments on commit 26de8be

Please sign in to comment.