From 289521886bc5819790c92da6cdf24898aacbaf58 Mon Sep 17 00:00:00 2001 From: Trinity Pointard Date: Sat, 29 May 2021 21:22:15 +0200 Subject: make most changes suggested during install-party --- src/rpc/rpc_client.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/rpc') diff --git a/src/rpc/rpc_client.rs b/src/rpc/rpc_client.rs index 5ed43d44..806c7e69 100644 --- a/src/rpc/rpc_client.rs +++ b/src/rpc/rpc_client.rs @@ -279,9 +279,13 @@ impl RpcHttpClient { tls_config: &Option, ) -> Result { let method = if let Some(cf) = tls_config { - let ca_certs = tls_util::load_certs(&cf.ca_cert)?; - let node_certs = tls_util::load_certs(&cf.node_cert)?; - let node_key = tls_util::load_private_key(&cf.node_key)?; + let ca_certs = tls_util::load_certs(&cf.ca_cert).map_err(|e| { + Error::Message(format!("Failed to open CA certificate file: {:?}", e)) + })?; + let node_certs = tls_util::load_certs(&cf.node_cert) + .map_err(|e| Error::Message(format!("Failed to open certificate file: {:?}", e)))?; + let node_key = tls_util::load_private_key(&cf.node_key) + .map_err(|e| Error::Message(format!("Failed to open private key file: {:?}", e)))?; let mut config = rustls::ClientConfig::new(); -- cgit v1.2.3