Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Oct 16, 2023
1 parent 0eff052 commit 1d6b34a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions ntex-tls/examples/rustls-client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ async fn main() -> io::Result<()> {

// rustls config
let mut cert_store = RootCertStore::empty();
cert_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(
|ta| {
OwnedTrustAnchor::from_subject_spki_name_constraints(
ta.subject,
ta.spki,
ta.name_constraints,
)
},
));
cert_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| {
OwnedTrustAnchor::from_subject_spki_name_constraints(
ta.subject,
ta.spki,
ta.name_constraints,
)
}));
let config = ClientConfig::builder()
.with_safe_defaults()
.with_root_certificates(cert_store)
Expand Down

0 comments on commit 1d6b34a

Please sign in to comment.