Skip to content

Commit

Permalink
feat: Make reqwest TLS backend configuration easy.
Browse files Browse the repository at this point in the history
We provide the choice of `native-tls` or `rust-tls`. If none is
provided, the user can configure on their on similar to how it's done
in `git-repository`.

Please note that a choice now has to be made or HTTPS will not be
available, so use one of…

* blocking-http-transport-reqwest-rust-tls
* blocking-http-transport-reqwest-native-tls
  • Loading branch information
Byron committed Nov 21, 2022
1 parent 03ff188 commit 3ddbd2d
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 3 deletions.
126 changes: 125 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ gitoxide-core-blocking-client = ["gitoxide-core/blocking-client"]
## Support synchronous 'http' and 'https' transports (e.g. for clone, fetch and push) using **curl**.
http-client-curl = ["git-repository/blocking-http-transport-curl"]
## Support synchronous 'http' and 'https' transports (e.g. for clone, fetch and push) using **reqwest**.
http-client-reqwest = ["git-repository/blocking-http-transport-reqwest", "reqwest-for-configuration-only", "reqwest-for-configuration-only/rustls-tls", "reqwest-for-configuration-only/trust-dns"]
http-client-reqwest = ["git-repository/blocking-http-transport-reqwest-rust-tls"]
## Use async client networking.
gitoxide-core-async-client = ["gitoxide-core/async-client", "futures-lite"]

Expand All @@ -87,7 +87,6 @@ anyhow = "1.0.42"
gitoxide-core = { version = "^0.20.0", path = "gitoxide-core" }
git-features = { version = "^0.23.1", path = "git-features" }
git-repository = { version = "^0.28.0", path = "git-repository", default-features = false }
reqwest-for-configuration-only = { package = "reqwest", version = "0.11.13", default-features = false, optional = true }

clap = { version = "3.2.5", features = ["derive", "cargo"] }
prodash = { version = "21", optional = true, default-features = false }
Expand Down
7 changes: 7 additions & 0 deletions git-repository/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ blocking-network-client = ["git-protocol/blocking-client"]
blocking-http-transport-curl = ["blocking-network-client", "git-transport/http-client-curl"]
## Stacks with `blocking-network-client` to provide support for HTTP/S using **reqwest**, and implies blocking networking as a whole.
blocking-http-transport-reqwest = ["blocking-network-client", "git-transport/http-client-reqwest"]
## Stacks with `blocking-http-transport-reqwest` and enables HTTPS via the `rustls` crate. Note that https isn't available without a selection.
blocking-http-transport-reqwest-rust-tls = ["blocking-http-transport-reqwest", "reqwest-for-configuration-only/rustls-tls", "reqwest-for-configuration-only/trust-dns"]
## Stacks with `blocking-http-transport-reqwest` and enables HTTPS via the `native-tls` crate. Note that https isn't available without a selection.
blocking-http-transport-reqwest-native-tls = ["blocking-http-transport-reqwest", "reqwest-for-configuration-only/default-tls" ]


#! ### Other
Expand Down Expand Up @@ -128,6 +132,9 @@ async-std = { version = "1.12.0", optional = true }
## how a simple unanchored regex of only 'normal' characters would work.
regex = { version = "1.6.0", optional = true, default-features = false, features = ["std"] }

# For internal use to allow pure-Rust builds without opensssl.
reqwest-for-configuration-only = { package = "reqwest", version = "0.11.13", default-features = false, optional = true }

document-features = { version = "0.2.0", optional = true }

[target.'cfg(target_vendor = "apple")'.dependencies]
Expand Down
1 change: 1 addition & 0 deletions src/gix.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//! The `gitoxide` plumbing.
//! ## Feature Flags
#![cfg_attr(
feature = "document-features",
Expand Down

0 comments on commit 3ddbd2d

Please sign in to comment.