From 380a4f2588cf9800bde739eb3ba58ca67b785291 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Tue, 7 Dec 2021 16:34:03 +1100 Subject: [PATCH] Disable reqwest's default features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By default, reqwest uses openssl for TLS. Any consumer wanting to use rustls will thus pull in unnecessary dependencies. To make getting started with bdk and reqwest easier, we add a `reqwest-default-tls` feature that can be used to activate reqwest's `default-tls` feature. TLS is necessary for the esplora integration. Adding this feature makes it possible for people to use bdk with esplora without adding a reqwest dependency to their manifest. --- CHANGELOG.md | 2 ++ Cargo.toml | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9fe4e79..5e833ab6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Unify ureq and reqwest esplora backends to have the same configuration parameters. This means reqwest now has a timeout parameter and ureq has a concurrency parameter. - Fixed esplora fee estimation. - Fixed generating WIF in the correct network format. +- Disable `reqwest` default features. +- Added `reqwest-default-tls` feature: Use this to restore the TLS defaults of reqwest if you don't want to add a dependency to it in your own manifest. ## [v0.14.0] - [v0.13.0] diff --git a/Cargo.toml b/Cargo.toml index f97f3f13..ef7fc9b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ sled = { version = "0.34", optional = true } electrum-client = { version = "0.8", optional = true } rusqlite = { version = "0.25.3", optional = true } ahash = { version = "=0.7.4", optional = true } -reqwest = { version = "0.11", optional = true, features = ["json"] } +reqwest = { version = "0.11", optional = true, default-features = false, features = ["json"] } ureq = { version = "~2.2.0", features = ["json"], optional = true } futures = { version = "0.3", optional = true } async-trait = { version = "0.1", optional = true } @@ -82,6 +82,8 @@ use-esplora-ureq = ["esplora", "ureq", "ureq/socks"] # Typical configurations will not need to use `esplora` feature directly. esplora = [] +# Use below feature with `use-esplora-reqwest` to enable reqwest default TLS support +reqwest-default-tls = ["reqwest/default-tls"] # Debug/Test features test-blockchains = ["bitcoincore-rpc", "electrum-client"]