From bcfd328c04a674289d0c52834db550f26374f8c1 Mon Sep 17 00:00:00 2001 From: Waylon Cude Date: Mon, 1 Jun 2026 11:51:10 -0700 Subject: [PATCH] Less unwraps for certificates Oops missed a few. Should print real errors now --- src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index fe348f9..87cc9e5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,7 +117,7 @@ async fn main() -> ExitCode { Ok(certs) => match certs.collect::,_>>() { Ok(k) => k, Err(e) => { - error!("Could not read certificates."); + error!("Could not read certificates {}",&config.certfile); error!("{}",e); return ExitCode::FAILURE } @@ -129,7 +129,14 @@ async fn main() -> ExitCode { return ExitCode::FAILURE } }; - let key = PrivateKeyDer::from_pem_file(&config.keyfile).unwrap(); + let key = match PrivateKeyDer::from_pem_file(&config.keyfile){ + Ok(val) => val, + Err(e) => { + error!("Could not read key file {}",&config.keyfile); + error!("{}",e); + return ExitCode::FAILURE + } + }; let address = match IpAddr::from_str(&config.listen_address) { Ok(val) => val,