From 13d2e6a84d5315565ceaa2c6bccb33a504693782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-X=2E=20T=2E?= Date: Wed, 28 Oct 2026 20:33:08 -0400 Subject: [PATCH 1/3] fix: explicitly use `ring` crypto provider --- Cargo.lock | 1 + Cargo.toml | 2 +- apps/app-playground/src/main.rs | 1 + apps/app/src/main.rs | 2 ++ apps/labrinth/Cargo.toml | 8 +++++++- packages/app-lib/Cargo.toml | 3 ++- packages/app-lib/src/lib.rs | 8 ++++++++ 7 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e5f309744cf..59ba0ac5d2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13808,6 +13808,7 @@ dependencies = [ "regex", "reqwest 0.13.5", "rgb", + "rustls 0.23.46", "same-file", "serde", "serde-binhum", diff --git a/Cargo.toml b/Cargo.toml index 8f86595c711..e784e9a4cca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -182,7 +182,7 @@ rust-s3 = { version = "0.38.0", default-features = false, features = [ "tags", "tokio-rustls-tls", ] } -rustls = "0.23.46" +rustls = { version = "0.23.46", default-features = false } rustrict = { version = "0.7.39", default-features = false, features = ["censor"] } rusty-money = "0.5.1" same-file = "1.0.6" diff --git a/apps/app-playground/src/main.rs b/apps/app-playground/src/main.rs index 73319911c24..9364af976b7 100644 --- a/apps/app-playground/src/main.rs +++ b/apps/app-playground/src/main.rs @@ -39,6 +39,7 @@ pub async fn authenticate_run() -> theseus::Result { async fn main() -> theseus::Result<()> { println!("Starting."); + theseus::install_crypto_provider(); let _log_guard = theseus::start_logger("ModrinthApp"); // Initialize state diff --git a/apps/app/src/main.rs b/apps/app/src/main.rs index 4f37cc8b5d6..92ba33a5fce 100644 --- a/apps/app/src/main.rs +++ b/apps/app/src/main.rs @@ -115,6 +115,8 @@ async fn set_restart_after_pending_update( // if Tauri app is called with arguments, then those arguments will be treated as commands // ie: deep links or filepaths for .mrpacks fn main() { + theseus::install_crypto_provider(); + let runtime = tokio::runtime::Builder::new_multi_thread() .enable_all() .build() diff --git a/apps/labrinth/Cargo.toml b/apps/labrinth/Cargo.toml index 7169b8c6007..184e047e99e 100644 --- a/apps/labrinth/Cargo.toml +++ b/apps/labrinth/Cargo.toml @@ -95,7 +95,13 @@ regex = { workspace = true } reqwest = { workspace = true, features = ["http2", "json", "multipart", "rustls"] } rust_decimal = { workspace = true, features = ["serde-with-float", "serde-with-str"] } rust_iso3166 = { workspace = true } -rustls.workspace = true +rustls = { workspace = true, features = [ + "aws_lc_rs", + "logging", + "prefer-post-quantum", + "std", + "tls12", +] } rustrict = { workspace = true } rusty-money = { workspace = true } scalar_api_reference = { workspace = true, features = ["actix-web"] } diff --git a/packages/app-lib/Cargo.toml b/packages/app-lib/Cargo.toml index d510461d871..305f7854a0f 100644 --- a/packages/app-lib/Cargo.toml +++ b/packages/app-lib/Cargo.toml @@ -71,11 +71,12 @@ reqwest = { workspace = true, features = [ "http2", "json", "multipart", - "rustls", + "rustls-no-provider", "stream", "system-proxy", ] } rgb = { workspace = true } +rustls = { workspace = true, features = ["logging", "ring", "std", "tls12"] } same-file = { workspace = true } serde = { workspace = true, features = ["derive", "rc"] } serde-binhum = { workspace = true } diff --git a/packages/app-lib/src/lib.rs b/packages/app-lib/src/lib.rs index e368a16f893..0e2c04aace2 100644 --- a/packages/app-lib/src/lib.rs +++ b/packages/app-lib/src/lib.rs @@ -30,6 +30,14 @@ pub use logger::start_logger; pub use state::State; pub use util::fetch::DownloadReason; +/// Installs `ring` as the process-wide rustls crypto provider. +/// +/// Must be called before any TLS connection is made: reqwest is built with +/// `rustls-no-provider` and the friends socket relies on the process default. +pub fn install_crypto_provider() { + let _ = rustls::crypto::ring::default_provider().install_default(); +} + pub fn launcher_user_agent() -> String { const LAUNCHER_BASE_USER_AGENT: &str = concat!("modrinth/theseus/", env!("CARGO_PKG_VERSION"),); From cdbbdbfbef865541e1068a9fcb9e77b90f265a94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-X=2E=20T=2E?= Date: Wed, 28 Oct 2026 20:42:23 -0400 Subject: [PATCH 2/3] chore: add test to theseus_gui --- Cargo.lock | 1 + apps/app/Cargo.toml | 3 +++ apps/app/package.json | 1 + apps/app/src/main.rs | 13 +++++++++++++ 4 files changed, 18 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 59ba0ac5d2a..9aa8bcb382a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13864,6 +13864,7 @@ dependencies = [ "paste", "path-util", "rand 0.10.3", + "rustls 0.23.46", "serde", "serde_json", "serde_with", diff --git a/apps/app/Cargo.toml b/apps/app/Cargo.toml index e1754691de3..f86b64f88be 100644 --- a/apps/app/Cargo.toml +++ b/apps/app/Cargo.toml @@ -55,6 +55,9 @@ features = ["devtools", "macos-private-api", "protocol-asset"] [build-dependencies] tauri-build = { workspace = true, features = ["codegen"] } +[dev-dependencies] +rustls = { workspace = true, features = ["std"] } + [target.'cfg(target_os = "linux")'.dependencies] tauri-plugin-updater = { workspace = true, optional = true } diff --git a/apps/app/package.json b/apps/app/package.json index 8df4ce14582..f7c5d7dcaa5 100644 --- a/apps/app/package.json +++ b/apps/app/package.json @@ -6,6 +6,7 @@ "dev": "tauri dev --features export-app-events", "lint": "cargo clippy --all-targets --features updater", "lint:ancillary": "prettier --check .", + "test": "cargo nextest run --all-targets --no-fail-fast --locked --features updater", "fix": "cargo clippy --all-targets --features updater --fix --allow-dirty", "fix:ancillary": "prettier --write ." }, diff --git a/apps/app/src/main.rs b/apps/app/src/main.rs index 92ba33a5fce..78ead22e206 100644 --- a/apps/app/src/main.rs +++ b/apps/app/src/main.rs @@ -493,3 +493,16 @@ fn main() { } } } + +#[cfg(test)] +mod tests { + /// Builds a TLS config the way crates relying on rustls's process-level + /// provider do (e.g. async-tungstenite for the friends socket), with the + /// app's full dependency graph. This only fails here, not in app-lib's + /// own tests, because a conflicting provider feature can come from + /// unifying app-lib's dependencies with the Tauri plugins'. + #[test] + fn rustls_process_provider_is_resolvable() { + let _ = rustls::ClientConfig::builder(); + } +} From 6ee4bdb3c23db3d416ad2334761f72560e87cde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-X=2E=20T=2E?= Date: Wed, 28 Oct 2026 20:49:32 -0400 Subject: [PATCH 3/3] fix: tombi --- apps/app/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/app/Cargo.toml b/apps/app/Cargo.toml index f86b64f88be..f8c9bb12d9f 100644 --- a/apps/app/Cargo.toml +++ b/apps/app/Cargo.toml @@ -52,12 +52,12 @@ zip = { workspace = true } workspace = true features = ["devtools", "macos-private-api", "protocol-asset"] -[build-dependencies] -tauri-build = { workspace = true, features = ["codegen"] } - [dev-dependencies] rustls = { workspace = true, features = ["std"] } +[build-dependencies] +tauri-build = { workspace = true, features = ["codegen"] } + [target.'cfg(target_os = "linux")'.dependencies] tauri-plugin-updater = { workspace = true, optional = true }