Skip to content

Commit a5fe674

Browse files
authored
fix: install rustls provider (#62)
1 parent d1da510 commit a5fe674

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name = "init4-bin-base"
44
description = "Internal utilities for binaries produced by the init4 team"
55
keywords = ["init4", "bin", "base"]
66

7-
version = "0.10.0"
7+
version = "0.10.1"
88
edition = "2021"
99
rust-version = "1.81"
1010
authors = ["init4", "James Prestwich"]
@@ -56,6 +56,7 @@ tower = { version = "0.5.2", optional = true }
5656
aws-config = { version = "1.1.7", optional = true }
5757
aws-sdk-kms = { version = "1.15.0", optional = true }
5858
reqwest = { version = "0.12.15", optional = true }
59+
rustls = { version = "0.23.31", optional = true }
5960

6061
[dev-dependencies]
6162
ajj = "0.3.1"
@@ -66,9 +67,10 @@ signal-hook = "0.3.17"
6667
tokio = { version = "1.43.0", features = ["macros"] }
6768

6869
[features]
69-
default = ["alloy"]
70+
default = ["alloy", "rustls"]
7071
alloy = ["dep:alloy", "dep:async-trait", "dep:aws-config", "dep:aws-sdk-kms"]
7172
perms = ["dep:oauth2", "dep:tokio", "dep:reqwest", "dep:signet-tx-cache", "dep:eyre", "dep:axum", "dep:tower"]
73+
rustls = ["dep:rustls", "rustls/aws-lc-rs"]
7274

7375
[[example]]
7476
name = "oauth"

src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,11 @@ pub mod deps {
8181
pub fn init4() -> Option<utils::otlp::OtelGuard> {
8282
let guard = utils::tracing::init_tracing();
8383
utils::metrics::init_metrics();
84+
85+
// This will install the AWS-LC-Rust TLS provider for rustls, if no other
86+
// provider has been installed yet
87+
#[cfg(feature = "rustls")]
88+
let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();
89+
8490
guard
8591
}

0 commit comments

Comments
 (0)