fix(clickhouse): bypass system proxy to prevent connection failure

This commit is contained in:
srako
2026-06-09 16:23:13 +08:00
committed by GitHub
parent 20f4a4a5ce
commit 46eaaed8f1
+3 -2
View File
@@ -17,7 +17,8 @@ pub struct ChClient {
impl ChClient {
pub fn new(url: &str, username: Option<String>, password: Option<String>, timeout: Duration) -> Self {
let http = HttpClient::builder().connect_timeout(timeout).build().unwrap_or_else(|_| HttpClient::new());
let http =
HttpClient::builder().connect_timeout(timeout).no_proxy().build().unwrap_or_else(|_| HttpClient::new());
Self { http, base_url: url.trim_end_matches('/').to_string(), username, password }
}
@@ -28,7 +29,7 @@ impl ChClient {
ca_cert_path: Option<&str>,
timeout: Duration,
) -> Result<Self, String> {
let mut builder = HttpClient::builder().connect_timeout(timeout);
let mut builder = HttpClient::builder().connect_timeout(timeout).no_proxy();
if let Some(path) = ca_cert_path.map(str::trim).filter(|path| !path.is_empty()) {
let path = expand_cert_path(path);
let cert_bytes =