Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

* build: allow overriding the `reqwest` TLS backend. rustls with the `aws-lc-rs` provider stays the default; to use another backend, disable default features and add your own `reqwest` dependency selecting the TLS features you want (previously the `rustls`/`aws-lc-rs` provider was hardcoded and impossible to opt out of)

## 0.50.1 (2026-06-20)

* feat: Bot API 10.1 - [#325](https://github.com/ayrat555/frankenstein/pull/325)
Expand Down
11 changes: 10 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ categories = ["web-programming::http-client"]
[package.metadata.docs.rs]
all-features = true

# `default` enables rustls (with the `aws-lc-rs` provider) as the TLS backend for the
# reqwest client, keeping the previous behaviour. `reqwest?/rustls` is a no-op unless
# the reqwest client is enabled. To use a different backend, disable default features
# and add your own `reqwest` dependency selecting the TLS features you want (see README).
[features]
default = ["reqwest?/rustls"]
client-reqwest = ["trait-async", "dep:reqwest", "dep:tokio", "dep:serde_json"]
client-ureq = ["trait-sync", "dep:ureq", "dep:multipart", "dep:mime_guess", "dep:serde_json"]
trait-async = ["dep:async-trait"]
Expand Down Expand Up @@ -47,10 +52,14 @@ serde_with = { version = "3.0.0", default-features = false, features = ["macros"
thiserror = "2"
ureq = { version = "3.0.0", optional = true, default-features = false, features = ["rustls"] }

# The TLS backend is selected via the `default` feature (`reqwest?/rustls`) rather
# than hardcoded here, so downstreams can override it by disabling default features
# and bringing their own `reqwest` dependency (additive Cargo features otherwise make
# a hardcoded `rustls`/`aws-lc-rs` provider impossible to opt out of).
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.reqwest]
version = "0.13"
default-features = false
features = ["multipart", "stream", "rustls"]
features = ["multipart", "stream"]
optional = true

[target.'cfg(target_arch = "wasm32")'.dependencies.reqwest]
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,28 @@ For example for the async client add the following line to your `Cargo.toml` fil
frankenstein = { version = "0.50", features = ["client-reqwest"] }
```

### TLS backend for the `reqwest` client

By default (`default` feature) the `reqwest` client uses rustls with the `aws-lc-rs`
provider, keeping the previous behaviour. To pick a different backend, disable default
features and add your own `reqwest` dependency selecting the TLS features you want.
`reqwest`'s features are additive, so you only need to add the TLS feature —
`frankenstein` already enables `multipart`/`stream`. For example, to use rustls without
the `aws-lc-rs` provider (avoids pulling in `aws-lc-sys` and its C build; install your
own `rustls::crypto::CryptoProvider` before making requests):

```toml
frankenstein = { version = "0.50", default-features = false, features = ["client-reqwest"] }
reqwest = { version = "0.13", default-features = false, features = ["rustls-no-provider"] }
```

Or, to use native-tls:

```toml
frankenstein = { version = "0.50", default-features = false, features = ["client-reqwest"] }
reqwest = { version = "0.13", default-features = false, features = ["native-tls"] }
```

## Usage

Examples in this section use the blocking client (`frankenstein::Api`), but async examples would look the same (just replace `frankenstein::Api` with `frankenstein::AsyncApi`)
Expand Down