Skip to content

Commit 25f115a

Browse files
committed
fix(engine): install rustls provider with pools
1 parent b8cd998 commit 25f115a

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

engine/packages/guard/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ pub async fn start(config: rivet_config::Config, pools: rivet_pools::Pools) -> R
2121
Id::new_v1(config.dc_label()),
2222
)?;
2323

24-
// Initialize with a default CryptoProvider for rustls
25-
let provider = rustls::crypto::ring::default_provider();
26-
if provider.install_default().is_err() {
27-
tracing::debug!("crypto provider already installed in this process");
28-
}
29-
3024
// Share shared context
3125
let shared_state = shared_state::SharedState::new(&config, ctx.ups()?);
3226
shared_state.start().await?;

engine/packages/pools/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ reqwest.workspace = true
1818
rivet-config.workspace = true
1919
rivet-metrics.workspace = true
2020
rivet-util.workspace = true
21+
rustls.workspace = true
2122
serde.workspace = true
2223
tempfile.workspace = true
2324
thiserror.workspace = true

engine/packages/pools/src/pools.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ impl Pools {
2626
let token = CancellationToken::new();
2727
let node_id = NodeId::new();
2828

29+
install_rustls_provider();
30+
2931
let (ups, udb) = tokio::try_join!(
3032
crate::db::ups::setup(&config, client_name),
3133
crate::db::udb::setup(&config),
@@ -55,6 +57,8 @@ impl Pools {
5557
let token = CancellationToken::new();
5658
let node_id = NodeId::new();
5759

60+
install_rustls_provider();
61+
5862
let (ups, udb) = tokio::try_join!(
5963
crate::db::ups::setup(&config, client_name),
6064
crate::db::udb::setup(&config),
@@ -97,3 +101,10 @@ impl Pools {
97101
self.0.udb.clone().ok_or(Error::MissingUdbPool.into())
98102
}
99103
}
104+
105+
fn install_rustls_provider() {
106+
let provider = rustls::crypto::ring::default_provider();
107+
if provider.install_default().is_err() {
108+
tracing::debug!("crypto provider already installed in this process");
109+
}
110+
}

0 commit comments

Comments
 (0)