From 1c393afe4fe54c7d5ea4887f0690b0b79cdd9f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Er=C3=A8be=20-=20Romain=20Gerard?= Date: Fri, 8 Mar 2024 09:00:21 +0100 Subject: [PATCH] fix(tls): skip invalid system certificate --- src/tls.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tls.rs b/src/tls.rs index ccd81ef..292091a 100644 --- a/src/tls.rs +++ b/src/tls.rs @@ -72,7 +72,10 @@ pub fn tls_connector( // Load system certificates and add them to the root store let certs = rustls_native_certs::load_native_certs().with_context(|| "Cannot load system certificates")?; for cert in certs { - root_store.add(&Certificate(cert.as_ref().to_vec()))?; + if let Err(err) = root_store.add(&Certificate(cert.as_ref().to_vec())) { + warn!("cannot load a system certificate: {:?}", err); + continue + } } let mut config = ClientConfig::builder()