Merge bitcoindevkit/bdk#1179: build(esplora): Add async-https-rustls flag to esplora client

6817ca9bcbff957efb58f96886a30b6bd87c0cde ci: pin hyper-rustls version to 0.24.0 for 1.57 MSRV (thunderbiscuit)
4ee41dbc402121d14ffa099863bf35329851c1e4 build(esplora): Add async-https-rustls flag to esplora client (thunderbiscuit)

Pull request description:

  ### Description
  The bdk_esplora crate currently doesn't expose the [`async-https-rustls` flag offered by the rust-esplora-client](ef1925e1ee/Cargo.toml (L44)) crate and instead requires users to build using the `default-tls` flag on reqwest, which uses the platform-specific openssl library when compiling. This creates complications for cross-compilation, notably for our Android builds that currently support 3 architectures (`arm64-v8a`, `armeabi-v7a`, and `x86_64`). In order to solve this we can either compile the openssl libraries for each of the platforms we want to support, or use the rustls-tls version of reqwest. The second options is much easier and requires less fiddling with the internals of the Android native development kit and cross-compilation rabbit holes.

  Before we merge this I want to make sure I understand the tradeoffs between the `native-tls` and the `rustls-tls` and confirm that there are not potential issues there, but from what I understand they should provide the same functionality/security, and because these are already available/exposed in reqwest and rust-esplora-client, I think this should be a fairly straightforward additional feature we offer.

  ### Changelog notice
  ```txt
  Added:
    - New async-https-rustls feature flag for the bdk_esplora crate, allowing to compile rust-esplora-client using rustls-tls instead of the default native-tls.
  ```

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

ACKs for top commit:
  notmandatory:
    ACK 6817ca9bcbff957efb58f96886a30b6bd87c0cde
  realeinherjar:
    ACK 6817ca9bcb
  danielabrozzoni:
    ACK 6817ca9bcbff957efb58f96886a30b6bd87c0cde

Tree-SHA512: 1d417da7cf85e157d71f56442a06e817e8741822d7bff9089f7fbb70ff8b4854f1f52befbc348b849e9c98cae848b792d426cd5bf551e7a9089b15467d28efdd
This commit is contained in:
Steve Myers 2023-12-04 22:21:33 -06:00
commit 959b4f8172
No known key found for this signature in database
GPG Key ID: 8105A46B22C2D051
3 changed files with 7 additions and 3 deletions

View File

@ -32,12 +32,13 @@ jobs:
run: | run: |
cargo update -p log --precise "0.4.18" cargo update -p log --precise "0.4.18"
cargo update -p tempfile --precise "3.6.0" cargo update -p tempfile --precise "3.6.0"
cargo update -p reqwest --precise "0.11.18"
cargo update -p hyper-rustls --precise 0.24.0
cargo update -p rustls:0.21.9 --precise "0.21.1" cargo update -p rustls:0.21.9 --precise "0.21.1"
cargo update -p rustls:0.20.9 --precise "0.20.8" cargo update -p rustls:0.20.9 --precise "0.20.8"
cargo update -p tokio --precise "1.29.1" cargo update -p tokio --precise "1.29.1"
cargo update -p tokio-util --precise "0.7.8" cargo update -p tokio-util --precise "0.7.8"
cargo update -p flate2 --precise "1.0.26" cargo update -p flate2 --precise "1.0.26"
cargo update -p reqwest --precise "0.11.18"
cargo update -p h2 --precise "0.3.20" cargo update -p h2 --precise "0.3.20"
cargo update -p rustls-webpki:0.100.3 --precise "0.100.1" cargo update -p rustls-webpki:0.100.3 --precise "0.100.1"
cargo update -p rustls-webpki:0.101.7 --precise "0.101.1" cargo update -p rustls-webpki:0.101.7 --precise "0.101.1"

View File

@ -69,6 +69,10 @@ To build with the MSRV you will need to pin dependencies as follows:
cargo update -p log --precise "0.4.18" cargo update -p log --precise "0.4.18"
# tempfile 3.7.0 has MSRV 1.63.0+ # tempfile 3.7.0 has MSRV 1.63.0+
cargo update -p tempfile --precise "3.6.0" cargo update -p tempfile --precise "3.6.0"
# reqwest 0.11.19 has MSRV 1.63.0+
cargo update -p reqwest --precise "0.11.18"
# hyper-rustls 0.24.1 has MSRV 1.60.0+
cargo update -p hyper-rustls --precise 0.24.0
# rustls 0.21.7 has MSRV 1.60.0+ # rustls 0.21.7 has MSRV 1.60.0+
cargo update -p rustls:0.21.9 --precise "0.21.1" cargo update -p rustls:0.21.9 --precise "0.21.1"
# rustls 0.20.9 has MSRV 1.60.0+ # rustls 0.20.9 has MSRV 1.60.0+
@ -79,8 +83,6 @@ cargo update -p tokio --precise "1.29.1"
cargo update -p tokio-util --precise "0.7.8" cargo update -p tokio-util --precise "0.7.8"
# flate2 1.0.27 has MSRV 1.63.0+ # flate2 1.0.27 has MSRV 1.63.0+
cargo update -p flate2 --precise "1.0.26" cargo update -p flate2 --precise "1.0.26"
# reqwest 0.11.19 has MSRV 1.63.0+
cargo update -p reqwest --precise "0.11.18"
# h2 0.3.21 has MSRV 1.63.0+ # h2 0.3.21 has MSRV 1.63.0+
cargo update -p h2 --precise "0.3.20" cargo update -p h2 --precise "0.3.20"
# rustls-webpki 0.100.3 has MSRV 1.60.0+ # rustls-webpki 0.100.3 has MSRV 1.60.0+

View File

@ -30,4 +30,5 @@ default = ["std", "async-https", "blocking"]
std = ["bdk_chain/std"] std = ["bdk_chain/std"]
async = ["async-trait", "futures", "esplora-client/async"] async = ["async-trait", "futures", "esplora-client/async"]
async-https = ["async", "esplora-client/async-https"] async-https = ["async", "esplora-client/async-https"]
async-https-rustls = ["async", "esplora-client/async-https-rustls"]
blocking = ["esplora-client/blocking"] blocking = ["esplora-client/blocking"]