From df2f30ea1fef102a8f1300d8f30058df54126c0d Mon Sep 17 00:00:00 2001 From: lifegpc Date: Sat, 24 Sep 2022 09:50:41 +0000 Subject: [PATCH] Set SSL_CERT_FILE if cert.pem is exists in executable path and SSL_CERT_FILE is not set. --- src/main.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main.rs b/src/main.rs index 4ec57a7..8bf4a2b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -127,6 +127,19 @@ impl Main { None => {} } get_helper().update(cmd.clone(), self.settings.as_ref().unwrap().clone()); + #[cfg(target_os = "windows")] + { + match std::env::var("SSL_CERT_FILE") { + Ok(_) => {} + Err(_) => { + let mut cert = utils::get_exe_path_else_current(); + cert.push("cert.pem"); + if cert.exists() { + std::env::set_var("SSL_CERT_FILE", cert); + } + } + } + } match cmd.cmd { Command::Config => { self.deal_config_cmd();