Skip to content

fix: force reqwest to always use rustls backend#3486

Merged
Frando merged 2 commits intomainfrom
Frando/reqwest-rustls
Sep 30, 2025
Merged

fix: force reqwest to always use rustls backend#3486
Frando merged 2 commits intomainfrom
Frando/reqwest-rustls

Conversation

@Frando
Copy link
Copy Markdown
Member

@Frando Frando commented Sep 30, 2025

Description

This changes all uses of reqwest in iroh to use ClientBuilder::use_rustls_tls() to force using the rustls TLS backend, even if the default-tls feature got enabled through feature unification (we don't enable it in iroh directly).

Reasoning:

We have reports of HTTPS net report probes failing. They do fail under the following circumstances:

  • We append a final dot to relay URL domains, to force absolute DNS resolution without appending a search domain
  • reqwest uses the native-tls backend (which is platform dependent, and is openssl on linux) whenever the default-tls feature is enabled. it is on by default. if both rustls-tls and default-tls features are enabled, the native-tls backend wins.
  • in iroh, we use reqwest with default-features = false, features = ["rustls-tls"], so without other deps changing features, the rustls backend is used
  • the rustls backend apparently cleans up the domain name, removing a final dot if present, before comparing it to the certificate's hostname
  • openssl apparently does not do that, so if the passed-in hostname has a final dot, but the certificate has not, an SSL verification error is thrown
  • now, if any other crate in a binary's deps enables the default-tls feature for reqwest, due to feature unification iroh now by default also uses the native tls backend and not rustls anymore

Breaking Changes

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 30, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/3486/docs/iroh/

Last updated: 2025-09-30T10:48:17Z

@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 30, 2025

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: 8a3d89c

@dignifiedquire
Copy link
Copy Markdown
Contributor

looks like this is not available in wasm

@Frando
Copy link
Copy Markdown
Member Author

Frando commented Sep 30, 2025

Pushed a commit that cfg's it out for wasm

@n0bot n0bot bot added this to iroh Sep 30, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Sep 30, 2025
@Frando Frando added this pull request to the merge queue Sep 30, 2025
Merged via the queue into main with commit 60d5310 Sep 30, 2025
30 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Sep 30, 2025
@dignifiedquire dignifiedquire deleted the Frando/reqwest-rustls branch September 30, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants