diff --git a/src/transport/tls.rs b/src/transport/tls.rs index d6a246f..20b14ab 100644 --- a/src/transport/tls.rs +++ b/src/transport/tls.rs @@ -32,8 +32,11 @@ impl Transport for TlsTransport { let connector = match config.trusted_root.as_ref() { Some(path) => { - let s = fs::read_to_string(path).await?; - let cert = Certificate::from_pem(s.as_bytes())?; + let s = fs::read_to_string(path) + .await + .with_context(|| "Failed to read the `tls.trusted_root`")?; + let cert = Certificate::from_pem(s.as_bytes()) + .with_context(|| "Failed to read certificate from `tls.trusted_root`")?; let connector = native_tls::TlsConnector::builder() .add_root_certificate(cert) .build()?;