propagate better message from RustlsConfig load error. (#734)

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2025-04-09 03:35:40 +00:00 committed by Jade Ellis
parent eac713a2a9
commit 83126cc667
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2

View file

@ -31,12 +31,14 @@ pub(super) async fn serve(
.install_default() .install_default()
.expect("failed to initialise aws-lc-rs rustls crypto provider"); .expect("failed to initialise aws-lc-rs rustls crypto provider");
debug!("Using direct TLS. Certificate path {certs} and certificate private key path {key}",);
info!( info!(
"Note: It is strongly recommended that you use a reverse proxy instead of running \ "Note: It is strongly recommended that you use a reverse proxy instead of running \
conduwuit directly with TLS." conduwuit directly with TLS."
); );
let conf = RustlsConfig::from_pem_file(certs, key).await?; debug!("Using direct TLS. Certificate path {certs} and certificate private key path {key}",);
let conf = RustlsConfig::from_pem_file(certs, key)
.await
.map_err(|e| err!(Config("tls", "Failed to load certificates or key: {e}")))?;
let mut join_set = JoinSet::new(); let mut join_set = JoinSet::new();
let app = app.into_make_service_with_connect_info::<SocketAddr>(); let app = app.into_make_service_with_connect_info::<SocketAddr>();