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

#41 in Network programming

Download history 528926/week @ 2024-01-03 543260/week @ 2024-01-10 634857/week @ 2024-01-17 601529/week @ 2024-01-24 635208/week @ 2024-01-31 645909/week @ 2024-02-07 608028/week @ 2024-02-14 642547/week @ 2024-02-21 676550/week @ 2024-02-28 693484/week @ 2024-03-06 703028/week @ 2024-03-13 728774/week @ 2024-03-20 702601/week @ 2024-03-27 753947/week @ 2024-04-03 769772/week @ 2024-04-10 641057/week @ 2024-04-17

3,005,111 downloads per month
Used in 2,019 crates (422 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–16MB
~198K SLoC