Skip to content

feat(http-transport-reqwest): allow tls options#7798

Open
erickguan wants to merge 1 commit into
mainfrom
feat/reqwest-tls-options
Open

feat(http-transport-reqwest): allow tls options#7798
erickguan wants to merge 1 commit into
mainfrom
feat/reqwest-tls-options

Conversation

@erickguan

Copy link
Copy Markdown
Member

Which issue does this PR close?

Closes #7762.

Rationale for this change

Allow easier configurations of TLS backend to reqwest.

What changes are included in this PR?

  • TLS configurations
  • feature knobs

Are there any user-facing changes?

Yes, for http-transport-reqwest. The default configuration for http-transport-reqwest is to compile native-tls support.

Users who wants rustls must compile their own http-transport-reqwest.

AI Usage Statement

Claude Opus 4.6 helps implementation.

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Jun 18, 2026
@erickguan

erickguan commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

@Xuanwo Can you have a look on the default feature proposed in PR? Then I can resolve build issues in CI.

Comment thread core/Cargo.toml
layers-throttle = ["dep:opendal-layer-throttle"]
layers-timeout = ["dep:opendal-layer-timeout"]
layers-tracing = ["dep:opendal-layer-tracing"]
reqwest-rustls-no-provider-tls = [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should keep them for deprecation

# Use Rustls without a built-in crypto provider.
rustls-no-provider = ["reqwest/rustls-no-provider"]
# Use Rustls with the aws-lc-rs crypto provider and bundled Mozilla root certificates.
webpki-roots = [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be rustls-wekpki-roots?

reqwest = { version = "0.13.4", features = [
"stream",
], default-features = false }
rustls = { version = "0.23", optional = true, default-features = false }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I expect we didn't depend on rustls directly

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure, I will change features.

The `native-tls` feature sidesteps both axes by delegating everything to
the OS TLS library (SChannel / Secure Transport / OpenSSL).

### Feature matrix

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The matrix here seems not reflect the two axes mentioned before. Where is ring and where is native certs?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I didn't include ring as a backend. The documentation gives information for readers to understand these concepts and crates. Do we want to provide ring as a choice for backend? Because users will have to compile their own binary. If they know that, they will be capable of building 50 line configurations. For us, what default features do we want to ship? I am only considering native certs.

native-tls is the native certs.

```rust
use std::time::Duration;

use opendal_http_transport_reqwest::ReqwestTlsBackend;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I didn't expect we need to implement this. Is there a reason why we didn't just use things from reqwest?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is mainly a consideration of what features do we want to compile and ship. e.g.:

  1. we ship rustls, ring, all differents certs
  2. we ship one feature of rustls
  3. ...other combinations between these 2

Bindings will use this crate mostly so compilation size is also a concern.

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

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new feature: allow TLS certification config

2 participants