(pem: &[u8])
| 193 | } |
| 194 | |
| 195 | fn load_private_key(pem: &[u8]) -> Result<PrivateKeyDer<'static>> { |
| 196 | let mut cursor = Cursor::new(pem); |
| 197 | let key = rustls_pemfile::private_key(&mut cursor) |
| 198 | .into_diagnostic()? |
| 199 | .ok_or_else(|| miette::miette!("no private key found in TLS key PEM"))?; |
| 200 | Ok(key) |
| 201 | } |
| 202 | |
| 203 | pub fn build_rustls_config(materials: &TlsMaterials) -> Result<rustls::ClientConfig> { |
| 204 | let mut roots = RootCertStore::empty(); |
no outgoing calls
no test coverage detected