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:
Argenis 2026-02-15 11:10:28 -05:00 committed by GitHub
parent ced4d70814
commit 128b30cdf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 0 deletions

1
Cargo.lock generated
View file

@ -2957,6 +2957,7 @@ dependencies = [
"mail-parser",
"reqwest",
"rusqlite",
"rustls",
"rustls-pki-types",
"serde",
"serde_json",

View file

@ -66,6 +66,7 @@ futures-util = { version = "0.3", default-features = false, features = ["sink"]
hostname = "0.4.2"
lettre = { version = "0.11.19", default-features = false, features = ["builder", "smtp-transport", "rustls-tls"] }
mail-parser = "0.11.2"
rustls = "0.23"
rustls-pki-types = "1.14.0"
tokio-rustls = "0.26.4"
webpki-roots = "1.0.6"

View file

@ -255,6 +255,13 @@ enum IntegrationCommands {
#[tokio::main]
#[allow(clippy::too_many_lines)]
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();
// Initialize logging