MCPcopy Create free account
hub / github.com/actix/examples / load_rustls_config

Function load_rustls_config

https-tls/rustls/src/main.rs:44–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42}
43
44fn load_rustls_config() -> rustls::ServerConfig {
45 rustls::crypto::aws_lc_rs::default_provider()
46 .install_default()
47 .unwrap();
48
49 // load TLS key/cert files
50 let cert_chain = CertificateDer::pem_file_iter("cert.pem")
51 .unwrap()
52 .flatten()
53 .collect();
54
55 let key_der =
56 PrivateKeyDer::from_pem_file("key.pem").expect("Could not locate PKCS 8 private keys.");
57
58 ServerConfig::builder()
59 .with_no_client_auth()
60 .with_single_cert(cert_chain, key_der)
61 .unwrap()
62}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected