Revert TLS changes causing docker build fail (#2937)

* Revert TLS changes causing docker build fail

* Update build to push
This commit is contained in:
Geometrically
2024-11-11 18:31:06 -08:00
committed by GitHub
parent 42db6001ed
commit 7bb3059cd9
7 changed files with 148 additions and 234 deletions

View File

@@ -1,3 +1,6 @@
use hyper::client::HttpConnector;
use hyper_tls::{native_tls, HttpsConnector};
mod fetch;
pub use fetch::*;
@@ -11,16 +14,15 @@ pub async fn init_client_with_database(
database: &str,
) -> clickhouse::error::Result<clickhouse::Client> {
let client = {
let tls_connector = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.expect("no native root CA certificates found")
.https_only()
.enable_http1()
.build();
let hyper_client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new(),
)
.build(tls_connector);
let mut http_connector = HttpConnector::new();
http_connector.enforce_http(false); // allow https URLs
let tls_connector =
native_tls::TlsConnector::builder().build().unwrap().into();
let https_connector =
HttpsConnector::from((http_connector, tls_connector));
let hyper_client =
hyper::client::Client::builder().build(https_connector);
clickhouse::Client::with_http_client(hyper_client)
.with_url(dotenvy::var("CLICKHOUSE_URL").unwrap())