[GH-ISSUE #596] Use ring as default crypto provider with rustls #345

Closed
opened 2026-03-02 23:46:44 +03:00 by kerem · 2 comments
Owner

Originally created by @pstumpf on GitHub (Nov 2, 2024).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/596

librespot has already switched to not using rustls' new default crypto provider aws-lc-sys as of github.com/kingosticks/librespot@24bbc6314c .

spotify-player should follow. aws-lc does not even work on a lot of platforms.

With this diff, I still get the aws-lc-sys dependency pulled in on OpenBSD, but at least the application works now.

diff --git a/spotify_player/Cargo.toml b/spotify_player/Cargo.toml
index 75678d2..cd4f29c 100644
--- a/spotify_player/Cargo.toml
+++ b/spotify_player/Cargo.toml
@@ -57,7 +57,7 @@ clap_complete = "4.5.35"
 which = "7.0.0"
 fuzzy-matcher = { version = "0.3.7", optional = true }
 html-escape = "0.2.13"
-rustls = "0.23.16"
+rustls = { version = "0.23.16", default-features = false, features = ["ring"] }
 
 [target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies.winit]
 version = "0.30.5"
diff --git a/spotify_player/src/main.rs b/spotify_player/src/main.rs
index 4d00e99..2342900 100644
--- a/spotify_player/src/main.rs
+++ b/spotify_player/src/main.rs
@@ -221,7 +221,7 @@ async fn start_app(state: &state::SharedState) -> Result<()> {
 fn main() -> Result<()> {
     // librespot depends on hyper-rustls which requires a crypto provider to be set up.
     // TODO: see if this can be fixed upstream
-    rustls::crypto::aws_lc_rs::default_provider()
+    rustls::crypto::ring::default_provider()
         .install_default()
         .unwrap();
 

Originally created by @pstumpf on GitHub (Nov 2, 2024). Original GitHub issue: https://github.com/aome510/spotify-player/issues/596 librespot has already switched to not using rustls' new default crypto provider aws-lc-sys as of https://github.com/kingosticks/librespot/commit/24bbc6314c991c64d1846162f739f223c44e5779 . spotify-player should follow. aws-lc does not even work on a lot of platforms. With this diff, I still get the aws-lc-sys dependency pulled in on OpenBSD, but at least the application works now. ``` diff --git a/spotify_player/Cargo.toml b/spotify_player/Cargo.toml index 75678d2..cd4f29c 100644 --- a/spotify_player/Cargo.toml +++ b/spotify_player/Cargo.toml @@ -57,7 +57,7 @@ clap_complete = "4.5.35" which = "7.0.0" fuzzy-matcher = { version = "0.3.7", optional = true } html-escape = "0.2.13" -rustls = "0.23.16" +rustls = { version = "0.23.16", default-features = false, features = ["ring"] } [target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies.winit] version = "0.30.5" diff --git a/spotify_player/src/main.rs b/spotify_player/src/main.rs index 4d00e99..2342900 100644 --- a/spotify_player/src/main.rs +++ b/spotify_player/src/main.rs @@ -221,7 +221,7 @@ async fn start_app(state: &state::SharedState) -> Result<()> { fn main() -> Result<()> { // librespot depends on hyper-rustls which requires a crypto provider to be set up. // TODO: see if this can be fixed upstream - rustls::crypto::aws_lc_rs::default_provider() + rustls::crypto::ring::default_provider() .install_default() .unwrap(); ```
kerem 2026-03-02 23:46:44 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@aome510 commented on GitHub (Nov 2, 2024):

can you open a PR?

<!-- gh-comment-id:2453114983 --> @aome510 commented on GitHub (Nov 2, 2024): can you open a PR?
Author
Owner

@pstumpf commented on GitHub (Nov 2, 2024):

Just did.

<!-- gh-comment-id:2453118562 --> @pstumpf commented on GitHub (Nov 2, 2024): Just did.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#345
No description provided.