1 unstable release
new 0.6.0 | Apr 17, 2025 |
---|
#51 in #https
63 downloads per month
Used in reqwest-spider
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
: Enablesnative-tls/alpn
, and ifh2
is negotiated, tells hyper.vendored
: Enablesnative-tls/vendored
, removing dependency on OpenSSL.
hyper-tls
Provides an HTTPS connector for use with hyper.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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