Skip to content

Commit

Permalink
CARL -> Improved error message when certificate or key file can't be …
Browse files Browse the repository at this point in the history
…found.
  • Loading branch information
mbfm committed Dec 21, 2023
1 parent 7445e4a commit 69284cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions opendut-carl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ pub async fn create(settings_override: Config) -> Result<()> {
let tls_config = {
let cert_path = project::make_path_absolute(settings.config.get_string("network.tls.certificate")?)?;
log::debug!("Using TLS certificate: {}", cert_path.display());
assert!(cert_path.exists(), "TLS certificate file at '{}' not found.", cert_path.display());

let key_path = project::make_path_absolute(settings.config.get_string("network.tls.key")?)?;
log::debug!("Using TLS key: {}", key_path.display());
assert!(key_path.exists(), "TLS key file at '{}' not found.", cert_path.display());

RustlsConfig::from_pem_file(cert_path, key_path).await?
};
Expand Down

0 comments on commit 69284cf

Please sign in to comment.