Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add experimental rustls support #309

Merged
merged 5 commits into from
Jan 8, 2022
Merged
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
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ spnego = ["curl-sys/spnego"]
static-curl = ["curl/static-curl"]
static-ssl = ["curl/static-ssl"]
text-decoding = ["encoding_rs", "mime"]
unstable-rustls-tls = ["curl/rustls"]
unstable-interceptors = []

[dependencies]
async-channel = "1.6"
castaway = "0.1"
crossbeam-utils = "0.8"
curl = "0.4.36"
curl-sys = "0.4.42"
curl = "0.4.42"
curl-sys = "0.4.52"
event-listener = "2.5"
futures-lite = "1.11"
http = "0.2.1"
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ Not every library is perfect for every use-case. While Isahc strives to be a ful

- **Tiny binaries**: If you are creating an application where tiny binary size is a key priority, you might find Isahc to be too large for you. While Isahc's dependencies are carefully curated and a number of features can be disabled, Isahc's core feature set includes things like async which does have some file size overhead. You might find something like [ureq] more suitable.
- **WebAssembly support**: If your project needs to be able to be compiled to WebAssembly, then Isahc will probably not work for you. Instead you might like an HTTP client that supports multiple backends such as [Surf].
- **Rustls support**: We hope to support [rustls] as a TLS backend someday, it is not currently supported directly. If for some reason rustls is a hard requirement for you, you'll need to use a different HTTP client for now.

## Sponsors

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ publish = false

[dependencies]
criterion = "0.3"
curl = "0.4"
curl = "0.4.42"
rayon = "1"
rouille = "3"

Expand Down
2 changes: 1 addition & 1 deletion examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use isahc::prelude::*;
fn main() -> Result<(), isahc::Error> {
// Send a GET request and wait for the response headers.
// Must be `mut` so we can read the response body.
let mut response = isahc::get("http://example.org")?;
let mut response = isahc::get("https://example.org")?;

// Print some basic info about the response to standard output.
println!("Status: {}", response.status());
Expand Down
11 changes: 8 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@
//! ```
//!
//! If you want to customize the request by adding headers, setting timeouts,
//! etc, then you can create a [`Request`][Request] using a
//! builder-style fluent interface, then finishing it off with a
//! [`send`][RequestExt::send]:
//! etc, then you can create a [`Request`][Request] using a builder-style fluent
//! interface, then finishing it off with a [`send`][RequestExt::send]:
//!
//! ```no_run
//! use isahc::{prelude::*, Request};
Expand Down Expand Up @@ -202,6 +201,12 @@
//! Unstable until the API is finalized. This an unstable feature whose
//! interface may change between patch releases.
//!
//! ### `unstable-rustls-tls`
//!
//! Use [rustls](https://github.com/rustls/rustls) as the TLS backend for HTTPS
//! requests. Currently unstable as the rustls backend in libcurl currently has
//! some known issues and is not yet recommended for production use.
//!
//! # Logging and tracing
//!
//! Isahc logs quite a bit of useful information at various levels compatible
Expand Down