Skip to content

Enable feature rustls-tls-native-roots for reqwest#7697

Merged
joncinque merged 1 commit intoanza-xyz:masterfrom
ffddw:rustls-native-roots
Aug 29, 2025
Merged

Enable feature rustls-tls-native-roots for reqwest#7697
joncinque merged 1 commit intoanza-xyz:masterfrom
ffddw:rustls-native-roots

Conversation

@ShoyuVanilla
Copy link
Copy Markdown

Problem

Since #5181, some cli apps like solana-cli aren't working well on environments that CAs are needed to connect to the RPC endpoints.

That's because its dependency reqwest isn't enabling any feature for loading CAs. I believe that it's reasonable to enable rustls-tls-native-roots, which loads system CAs via rustls-native-certs, because solana-cli is not a library but cli app, so the users can't really load CAs manually.

But why it had been working well before #5181? That was purely by accident by resolving with another dependency here:

goauth = "0.13.1"

goauth enables reqwest's default-tls feature by default
, and that feature automatically loads system CAs via OpenSSL.
Before #5181, there had been only single version of reqwest across the workspace, so it had been resolved with default-tls feature turned on implicitly. (And every tls things had been done via OpenSSL, not rustls)
But that PR has introduced the reqwest = "0.12", so there are two versions of reqwest now, 0.11 and 0.12. The former is still enabling default-tls feature but the later now lacks of it.

Summary of Changes

This makes cli apps like solana-cli to load system CAs

@mergify mergify Bot requested a review from a team August 25, 2025 08:03
@0xbrw
Copy link
Copy Markdown

0xbrw commented Aug 25, 2025

@yihau would you know the right person to review this?

Copy link
Copy Markdown

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! It makes sense to me, but let's localize the change to avoid pulling in more dependencies for crates unnecessarily.

Comment thread Cargo.toml Outdated
reed-solomon-erasure = "6.0.0"
regex = "1.11.2"
reqwest = { version = "0.12.23", default-features = false }
reqwest = { version = "0.12.23", default-features = false, features = ["rustls-tls-native-roots"] }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't enable all of these features for every crate using reqwest in the workspace.

Instead, can you only make the change in cli/Cargo.toml?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. I've enabled it for solana-cli and solana-cargo-build-sbf. We also have agave-install but since it's not only just a bin but also a lib published on crates.io I haven't enabled the feature for it.

@joncinque joncinque added the CI Pull Request is ready to enter CI label Aug 29, 2025
@anza-team anza-team removed the CI Pull Request is ready to enter CI label Aug 29, 2025
Copy link
Copy Markdown

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

And if you want, you can also add the feature to agave-install -- even though it's technically published as a lib, I think that's more to facilitate having multiple bins.

Also, it doesn't have any dependents: https://crates.io/crates/agave-install/reverse_dependencies, so it should be safe to change.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.0%. Comparing base (7865ba5) to head (1c1c1ab).
⚠️ Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #7697     +/-   ##
=========================================
- Coverage    83.1%    83.0%   -0.1%     
=========================================
  Files         812      812             
  Lines      356963   356963             
=========================================
- Hits       296642   296559     -83     
- Misses      60321    60404     +83     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joncinque
Copy link
Copy Markdown

Merging this PR, feel free to create a new one for agave-install -- thanks again for your contribution!

@joncinque joncinque merged commit cfc4cdc into anza-xyz:master Aug 29, 2025
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants