#https #hyper #http #tls

hyper-tls-spider

Default TLS implementation for use with hyper

1 unstable release

new 0.6.0 Apr 17, 2025

#51 in #https

Download history 59/week @ 2025-04-11

63 downloads per month
Used in reqwest-spider

MIT/Apache

16KB
266 lines

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.
  • vendored: Enables native-tls/vendored, removing dependency on OpenSSL.

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.

Dependencies

~5–16MB
~219K SLoC