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

#45 in Network programming

Download history 279352/week @ 2023-12-23 438676/week @ 2023-12-30 557612/week @ 2024-01-06 583476/week @ 2024-01-13 613609/week @ 2024-01-20 619222/week @ 2024-01-27 643911/week @ 2024-02-03 635181/week @ 2024-02-10 612103/week @ 2024-02-17 655794/week @ 2024-02-24 690562/week @ 2024-03-02 699921/week @ 2024-03-09 713075/week @ 2024-03-16 722726/week @ 2024-03-23 730190/week @ 2024-03-30 634313/week @ 2024-04-06

2,917,769 downloads per month
Used in 2,004 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–17MB
~208K SLoC