20 releases

0.6.0 Nov 27, 2023
0.5.0 Dec 29, 2020
0.4.3 Jul 6, 2020
0.4.1 Jan 9, 2020
0.0.0 Jan 4, 2017

#213 in Network programming

Download history 1027596/week @ 2024-08-15 1083460/week @ 2024-08-22 976991/week @ 2024-08-29 1071788/week @ 2024-09-05 1043577/week @ 2024-09-12 1205948/week @ 2024-09-19 1272896/week @ 2024-09-26 1642242/week @ 2024-10-03 1609961/week @ 2024-10-10 1726843/week @ 2024-10-17 1239628/week @ 2024-10-24 1046420/week @ 2024-10-31 1005533/week @ 2024-11-07 1107131/week @ 2024-11-14 1040347/week @ 2024-11-21 805488/week @ 2024-11-28

4,140,808 downloads per month
Used in 2,177 crates (433 directly)

MIT/Apache

16KB
266 lines

hyper-tls

Provides an HTTPS connector for use with hyper.

Documentation

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

hyper-tls

An HTTPS connector to be used with hyper.

Example

use bytes::Bytes;
use http_body_util::Empty;
use hyper_tls::HttpsConnector;
use hyper_util::{client::legacy::Client, rt::TokioExecutor};

#[tokio::main(flavor = "current_thread")]
async fn main() -> Result<(), Box<dyn std::error::Error>>{
    let https = HttpsConnector::new();
    let client = Client::builder(TokioExecutor::new()).build::<_, Empty<Bytes>>(https);

    let res = client.get("https://hyper.rs".parse()?).await?;
    assert_eq!(res.status(), 200);
    Ok(())
}

Crate Features

  • alpn: Enables native-tls/alpn, and if h2 is negotiated, tells hyper.

Dependencies

~5–15MB
~204K SLoC