mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-23 09:23:26 +00:00
fix(clickhouse): bypass system proxy to prevent connection failure
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user