mirror of
https://github.com/sadoyan/aralez.git
synced 2026-04-29 22:38:36 +08:00
Turned back to OpenSSL, with static link
This commit is contained in:
684
Cargo.lock
generated
684
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
14
Cargo.toml
14
Cargo.toml
@@ -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 }
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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,16 +50,18 @@ pub fn run() {
|
||||
// env_logger::init();
|
||||
|
||||
let log_level = cfg.log_level.clone();
|
||||
match log_level.as_str() {
|
||||
"info" => env::set_var("RUST_LOG", "info"),
|
||||
"error" => env::set_var("RUST_LOG", "error"),
|
||||
"warn" => env::set_var("RUST_LOG", "warn"),
|
||||
"debug" => env::set_var("RUST_LOG", "debug"),
|
||||
"trace" => env::set_var("RUST_LOG", "trace"),
|
||||
"off" => env::set_var("RUST_LOG", "off"),
|
||||
_ => {
|
||||
println!("Error reading log level, defaulting to: INFO");
|
||||
env::set_var("RUST_LOG", "info")
|
||||
unsafe {
|
||||
match log_level.as_str() {
|
||||
"info" => env::set_var("RUST_LOG", "info"),
|
||||
"error" => env::set_var("RUST_LOG", "error"),
|
||||
"warn" => env::set_var("RUST_LOG", "warn"),
|
||||
"debug" => env::set_var("RUST_LOG", "debug"),
|
||||
"trace" => env::set_var("RUST_LOG", "trace"),
|
||||
"off" => env::set_var("RUST_LOG", "off"),
|
||||
_ => {
|
||||
println!("Error reading log level, defaulting to: INFO");
|
||||
env::set_var("RUST_LOG", "info")
|
||||
}
|
||||
}
|
||||
}
|
||||
env_logger::builder()
|
||||
|
||||
Reference in New Issue
Block a user