fix: install default Rustls crypto provider to prevent TLS initialization error
Install ring-based crypto provider at startup to fix Rustls TLS initialization error
This commit is contained in:
parent
ced4d70814
commit
128b30cdf1
3 changed files with 9 additions and 0 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -2957,6 +2957,7 @@ dependencies = [
|
||||||
"mail-parser",
|
"mail-parser",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"rusqlite",
|
"rusqlite",
|
||||||
|
"rustls",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,7 @@ futures-util = { version = "0.3", default-features = false, features = ["sink"]
|
||||||
hostname = "0.4.2"
|
hostname = "0.4.2"
|
||||||
lettre = { version = "0.11.19", default-features = false, features = ["builder", "smtp-transport", "rustls-tls"] }
|
lettre = { version = "0.11.19", default-features = false, features = ["builder", "smtp-transport", "rustls-tls"] }
|
||||||
mail-parser = "0.11.2"
|
mail-parser = "0.11.2"
|
||||||
|
rustls = "0.23"
|
||||||
rustls-pki-types = "1.14.0"
|
rustls-pki-types = "1.14.0"
|
||||||
tokio-rustls = "0.26.4"
|
tokio-rustls = "0.26.4"
|
||||||
webpki-roots = "1.0.6"
|
webpki-roots = "1.0.6"
|
||||||
|
|
|
||||||
|
|
@ -255,6 +255,13 @@ enum IntegrationCommands {
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
#[allow(clippy::too_many_lines)]
|
#[allow(clippy::too_many_lines)]
|
||||||
async fn main() -> Result<()> {
|
async fn main() -> Result<()> {
|
||||||
|
// Install default crypto provider for Rustls TLS.
|
||||||
|
// This prevents the error: "could not automatically determine the process-level CryptoProvider"
|
||||||
|
// when both aws-lc-rs and ring features are available (or neither is explicitly selected).
|
||||||
|
if let Err(e) = rustls::crypto::ring::default_provider().install_default() {
|
||||||
|
eprintln!("Warning: Failed to install default crypto provider: {e:?}");
|
||||||
|
}
|
||||||
|
|
||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
||||||
// Initialize logging
|
// Initialize logging
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue