mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
fmt
This commit is contained in:
@ -66,15 +66,13 @@ async fn main() -> std::io::Result<()> {
|
||||
/// Create simple rustls client config from root certificates.
|
||||
fn rustls_config() -> ClientConfig {
|
||||
let mut root_store = RootCertStore::empty();
|
||||
root_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,
|
||||
)
|
||||
},
|
||||
));
|
||||
root_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,
|
||||
)
|
||||
}));
|
||||
|
||||
rustls::ClientConfig::builder()
|
||||
.with_safe_defaults()
|
||||
|
Reference in New Issue
Block a user