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

#205 in Network programming

Download history 971826/week @ 2024-07-29 947123/week @ 2024-08-05 1070864/week @ 2024-08-12 1087551/week @ 2024-08-19 1058748/week @ 2024-08-26 997283/week @ 2024-09-02 1062594/week @ 2024-09-09 1114821/week @ 2024-09-16 1146289/week @ 2024-09-23 1473507/week @ 2024-09-30 1802983/week @ 2024-10-07 1704503/week @ 2024-10-14 1342846/week @ 2024-10-21 1151563/week @ 2024-10-28 1035279/week @ 2024-11-04 996798/week @ 2024-11-11

4,747,283 downloads per month
Used in 2,170 crates (431 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