[PR #471] [MERGED] Fix ureq-native-tls feature to actually use native-tls #478

Closed
opened 2026-02-27 20:24:52 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/471
Author: @jirutka
Created: 3/31/2024
Status: Merged
Merged: 4/1/2024
Merged by: @ramsayleung

Base: masterHead: ureq-native-tls


📝 Commits (2)

  • 2caa813 Fix ureq-native-tls feature to actually use native-tls
  • e3e9d2b CI: Add job to test ureq-native-tls feature

📊 Changes

4 files changed (+23 additions, -5 deletions)

View changed files

📝 .github/workflows/ci.yml (+6 -1)
📝 CHANGELOG.md (+5 -0)
📝 rspotify-http/Cargo.toml (+2 -1)
📝 rspotify-http/src/ureq.rs (+10 -3)

📄 Description

Description

Feature ureq-native-tls currently doesn't work because ureq requires the TLS
connector to be specified explicitly for native-tls:

native-tls enables an adapter so you can pass a
native_tls::TlsConnector instance to AgentBuilder::tls_connector.
Due to the risk of diamond dependencies accidentally switching on an
unwanted TLS implementation, native-tls is never picked up as a
default or used by the crate level convenience calls (ureq::get
etc) – it must be configured on the agent.
-- https://github.com/algesten/ureq#features

When ncspot is built with rspotify with ureq-native-tls, it's unable to
create an HTTPS connection:

[ncspot::spotify_api] [DEBUG] http error: Transport(Transport { kind: UnknownScheme, message: Some("cannot make HTTPS request because no TLS backend is configured"), url: Some(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.spotify.com")), port: None, path: "/v1/me/", query: None, fragment: None }), source: None })

Motivation and Context

rspotify currently doesn’t work when built with ureq-native-tls.

Dependencies

tls-native (optional)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How has this been tested?

CI

Is this change properly documented?

Yes


Related to #402

Fixes hrkfdn/ncspot#1159


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ramsayleung/rspotify/pull/471 **Author:** [@jirutka](https://github.com/jirutka) **Created:** 3/31/2024 **Status:** ✅ Merged **Merged:** 4/1/2024 **Merged by:** [@ramsayleung](https://github.com/ramsayleung) **Base:** `master` ← **Head:** `ureq-native-tls` --- ### 📝 Commits (2) - [`2caa813`](https://github.com/ramsayleung/rspotify/commit/2caa813b5c78d148fd23dfb19536100b4f22efc7) Fix ureq-native-tls feature to actually use native-tls - [`e3e9d2b`](https://github.com/ramsayleung/rspotify/commit/e3e9d2b72c4a086f50daec28434aecbf5975c176) CI: Add job to test ureq-native-tls feature ### 📊 Changes **4 files changed** (+23 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+6 -1) 📝 `CHANGELOG.md` (+5 -0) 📝 `rspotify-http/Cargo.toml` (+2 -1) 📝 `rspotify-http/src/ureq.rs` (+10 -3) </details> ### 📄 Description ## Description Feature `ureq-native-tls` currently doesn't work because ureq requires the TLS connector to be specified explicitly for native-tls: > `native-tls` enables an adapter so you can pass a > `native_tls::TlsConnector` instance to `AgentBuilder::tls_connector`. > Due to the risk of diamond dependencies accidentally switching on an > unwanted TLS implementation, `native-tls` is never picked up as a > default or used by the crate level convenience calls (`ureq::get` > etc) – it must be configured on the agent. > -- https://github.com/algesten/ureq#features When ncspot is built with rspotify with ureq-native-tls, it's unable to create an HTTPS connection: [ncspot::spotify_api] [DEBUG] http error: Transport(Transport { kind: UnknownScheme, message: Some("cannot make HTTPS request because no TLS backend is configured"), url: Some(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("api.spotify.com")), port: None, path: "/v1/me/", query: None, fragment: None }), source: None }) ## Motivation and Context rspotify currently doesn’t work when built with `ureq-native-tls`. ## Dependencies `tls-native` (optional) ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) ## How has this been tested? CI ## Is this change properly documented? Yes * * * Related to #402 Fixes hrkfdn/ncspot#1159 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:24:52 +03:00
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/rspotify#478
No description provided.