diff --git a/src/tls.rs b/src/tls.rs index b695792..67438eb 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -51,6 +51,9 @@ pub(crate) fn server_load_certs(path: &Path) -> Result Result for key in rustls_pemfile::rsa_private_keys(&mut BufReader::new(File::open(path)?)) { res.push(PrivateKeyDer::from(key?)); } + for key in rustls_pemfile::pkcs8_private_keys(&mut BufReader::new(File::open(path)?)) { + res.push(PrivateKeyDer::from(key?)); + } + for key in rustls_pemfile::ec_private_keys(&mut BufReader::new(File::open(path)?)) { + res.push(PrivateKeyDer::from(key?)); + } + if res.is_empty() { + return Err("No keys found".into()); + } Ok(res) }