From e0e16fc3ab63006591c5890d7887177295bff2fa Mon Sep 17 00:00:00 2001 From: ssrlive <30760636+ssrlive@users.noreply.github.com> Date: Mon, 6 May 2024 13:42:07 +0800 Subject: [PATCH] Fix #56 --- src/tls.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) }