diff --git a/Cargo.lock b/Cargo.lock index 8d84ca7e84..b71ac07e0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4179,6 +4179,7 @@ dependencies = [ "openfang-wire", "rand 0.8.5", "reqwest 0.12.28", + "rustls 0.23.37", "serde", "serde_json", "subtle", diff --git a/Cargo.toml b/Cargo.toml index cc9672a111..edb6000f76 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,6 +63,7 @@ clap_complete = "4" # HTTP client (for LLM drivers) reqwest = { version = "0.12", default-features = false, features = ["json", "stream", "multipart", "rustls-tls", "gzip", "deflate", "brotli"] } +rustls = { version = "0.23", default-features = false, features = ["ring"] } # Async trait async-trait = "0.1" diff --git a/crates/openfang-kernel/Cargo.toml b/crates/openfang-kernel/Cargo.toml index c9176ef248..24f1119f88 100644 --- a/crates/openfang-kernel/Cargo.toml +++ b/crates/openfang-kernel/Cargo.toml @@ -33,6 +33,7 @@ subtle = { workspace = true } rand = { workspace = true } hex = { workspace = true } reqwest = { workspace = true } +rustls = { workspace = true } cron = "0.15" zeroize = { workspace = true } diff --git a/crates/openfang-kernel/src/kernel.rs b/crates/openfang-kernel/src/kernel.rs index d9fe60f971..69016b00b0 100644 --- a/crates/openfang-kernel/src/kernel.rs +++ b/crates/openfang-kernel/src/kernel.rs @@ -511,6 +511,13 @@ impl OpenFangKernel { /// Boot the kernel with an explicit configuration. pub fn boot_with_config(mut config: KernelConfig) -> KernelResult { + if rustls::crypto::ring::default_provider() + .install_default() + .is_err() + { + debug!("rustls crypto provider already installed, skipping"); + } + use openfang_types::config::KernelMode; // Env var overrides — useful for Docker where config.toml is baked in.