Skip to content

Add 'native-tls' feature to reqwest dependency#1166

Closed
crust3780 wants to merge 1 commit into
RightNow-AI:mainfrom
crust3780:patch-1
Closed

Add 'native-tls' feature to reqwest dependency#1166
crust3780 wants to merge 1 commit into
RightNow-AI:mainfrom
crust3780:patch-1

Conversation

@crust3780
Copy link
Copy Markdown

Summary

Fixes #1160

Changes

Enables native-tls in reqwest

Testing

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes
  • Live integration tested (if applicable)

Security

  • No new unsafe code
  • No secrets or API keys in diff
  • User input validated at boundaries

@crust3780
Copy link
Copy Markdown
Author

Tested it on MacOS and it solves my issue.

Copy link
Copy Markdown
Member

@jaberjaber23 jaberjaber23 left a comment

Choose a reason for hiding this comment

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

This adds the native-tls feature to reqwest but no call site actually selects native-tls at runtime. With rustls-tls already enabled, reqwest uses rustls by default. Net effect of this change as-is: ~100KB larger binary, no behavior change.

If the goal is to use the OS certificate store (e.g. corporate proxy with private CA), the change needs a second piece: a runtime select via reqwest::ClientBuilder::use_native_tls() or use_rustls_tls() on the specific clients that need it.

Could you describe the use case driving this and add the runtime select? Otherwise the feature flag is decorative.

@crust3780
Copy link
Copy Markdown
Author

I don't think that is the case in recent reqwest versions:

  1. the change is tested, I compiled it and didn't have any issues
  2. the official documentation does not mention that one should enable native tls manually (https://github.com/seanmonstar/reqwest#requirements), simply adding the feature is enough since it uses another backend

@crust3780 crust3780 requested a review from jaberjaber23 May 12, 2026 13:03
@jaberjaber23
Copy link
Copy Markdown
Member

Closing. The change adds the native-tls feature flag to reqwest but nothing in the tree uses it. Cargo.toml at line 65 already enables rustls-tls which is the preferred TLS backend for OpenFang and is doing the work today. Adding native-tls would pull OpenSSL into the dependency tree without any caller doing .use_native_tls() on ClientBuilder. If there's a concrete reason (corporate proxy with system CA pinning, FIPS requirement, etc.) please reopen with a use case and a code site that needs the switch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MacOS custom certificate

2 participants