Skip to content

Commit d806f76

Browse files
committed
adding cert on android print error instead of crash
Now when load_android_root_certs failed, it'll print error instead of return error.
1 parent 0cedaef commit d806f76

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/imp/openssl.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ fn load_android_root_certs(connector: &mut SslContextBuilder) -> Result<(), Erro
102102
.filter_map(|e| fs::read(e.path()).ok())
103103
.filter_map(|b| X509::from_pem(&b).ok());
104104
for cert in certs {
105-
connector.cert_store_mut().add_cert(cert)?;
105+
if let Err(err) = connector.cert_store_mut().add_cert(cert) {
106+
eprintln!("load_android_root_certs error: {:?}", err);
107+
}
106108
}
107109
}
108110

0 commit comments

Comments
 (0)