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

Function load_rustls_config

https-tls/cert-watch/src/main.rs:109–122  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

107}
108
109fn load_rustls_config() -> eyre::Result<rustls::ServerConfig> {
110 // load TLS key/cert files
111 let cert_chain = CertificateDer::pem_file_iter("cert.pem")
112 .unwrap()
113 .flatten()
114 .collect();
115
116 let key_der =
117 PrivateKeyDer::from_pem_file("key.pem").expect("Could not locate PKCS 8 private keys.");
118
119 Ok(ServerConfig::builder()
120 .with_no_client_auth()
121 .with_single_cert(cert_chain, key_der)?)
122}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected