Turned back to OpenSSL, with static link

This commit is contained in:
Ara Sadoyan
2025-05-21 15:54:38 +02:00
parent 8c192d9990
commit fce25b8d15
4 changed files with 226 additions and 506 deletions

684
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,14 +4,16 @@ version = "0.1.0"
edition = "2021"
[profile.release]
opt-level = 3
lto = true
codegen-units = 1
opt-level = 3
strip = "symbols"
panic = "abort"
strip = true
[dependencies]
tokio = { version = "1.45.0", features = ["full"] }
pingora = { version = "0.5.0", features = ["lb", "rustls"] } # openssl, rustls, boringssl
#pingora = { version = "0.5.0", features = ["lb", "rustls"] } # openssl, rustls, boringssl
pingora = { version = "0.5.0", features = ["lb", "openssl"] } # openssl, rustls, boringssl
serde = { version = "1.0.219", features = ["derive"] }
dashmap = "7.0.0-rc2"
pingora-core = "0.5.0"
@@ -23,9 +25,9 @@ log = "0.4.27"
futures = "0.3.31"
notify = "8.0.0"
axum = { version = "0.8.4" }
#reqwest = { version = "0.12.15", features = ["json", "native-tls-alpn"] }
reqwest = { version = "0.12.15", features = ["json", "native-tls-alpn"] }
#reqwest = { version = "0.12.15", features = ["json", "rustls-tls"] }
reqwest = { version = "0.12.15", default-features = false, features = ["rustls-tls", "json"] }
#reqwest = { version = "0.12.15", default-features = false, features = ["rustls-tls", "json"] }
serde_yaml = "0.9.34-deprecated"
rand = "0.9.0"
@@ -36,6 +38,6 @@ sha2 = { version = "0.11.0-pre.5", default-features = false }
base16ct = { version = "0.2.0", features = ["alloc"] }
urlencoding = "2.1.3"
arc-swap = "1.7.1"
rustls = { version = "0.23.27", features = ["ring"] }
#rustls = { version = "0.23.27", features = ["ring"] }
mimalloc = { version = "0.1.46", default-features = false }

View File

@@ -84,7 +84,13 @@ impl ProxyHttp for LB {
peer.options.verify_cert = false;
peer.options.verify_hostname = false;
}
// println!(" ==> {} ==> {} => {} => {:?}", hostname, address.as_str(), peer.options.alpn, is_h2);
// info!(
// "upstream peer: hostname {}, address{}, alpn {}, h2 {:?}",
// hostname,
// address.as_str(),
// peer.options.alpn,
// is_h2
// );
_ctx.backend_id = format!("{}:{}:{}", address.clone(), port.clone(), ssl);
Ok(peer)
}

View File

@@ -5,12 +5,12 @@ use dashmap::DashMap;
use log::info;
use pingora_core::prelude::{background_service, Opt};
use pingora_core::server::Server;
use rustls::crypto::ring::default_provider;
// use rustls::crypto::ring::default_provider;
use std::env;
use std::sync::Arc;
pub fn run() {
default_provider().install_default().expect("Failed to install rustls crypto provider");
// default_provider().install_default().expect("Failed to install rustls crypto provider");
let parameters = Some(Opt::parse_args()).unwrap();
let file = parameters.conf.clone().unwrap();
let maincfg = crate::utils::parceyaml::parce_main_config(file.as_str());
@@ -50,6 +50,7 @@ pub fn run() {
// env_logger::init();
let log_level = cfg.log_level.clone();
unsafe {
match log_level.as_str() {
"info" => env::set_var("RUST_LOG", "info"),
"error" => env::set_var("RUST_LOG", "error"),
@@ -62,6 +63,7 @@ pub fn run() {
env::set_var("RUST_LOG", "info")
}
}
}
env_logger::builder()
// .format_timestamp(None)
// .format_module_path(false)