Skip to content

Commit

Permalink
Merge pull request #152 from clux/aws-lc-rs
Browse files Browse the repository at this point in the history
aws-lc tests
  • Loading branch information
clux authored Feb 26, 2025
2 parents a0ca3da + 66cec6b commit ca99f4c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
10 changes: 6 additions & 4 deletions test/rustlscrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ version = "0.1.0"
edition = "2021"

[dependencies]
hyper = { version = "0.14.18", features = ["client"] }
hyper-rustls = "0.23.0"
rustls = "0.22"
tokio = { version = "1.18.2", features = ["rt-multi-thread", "macros"] }
http-body-util = "0.1.2"
hyper = { version = "1.6.0", features = ["client"] }
hyper-rustls = "0.27.5"
hyper-util = "0.1.10"
rustls = "0.23"
tokio = { version = "1.43.0", features = ["rt-multi-thread", "macros"] }
9 changes: 7 additions & 2 deletions test/rustlscrate/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
use hyper::{Body, Client, StatusCode, Uri};
use http_body_util::Empty;
use hyper::body::Bytes;
use hyper::http::StatusCode;
use hyper_util::client::legacy::Client;
use hyper_util::rt::TokioExecutor;

#[tokio::main]
async fn main() {
let url = ("https://hyper.rs").parse().unwrap();
let https = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.expect("no native root CA certificates found")
.https_only()
.enable_http1()
.build();

let client: Client<_, hyper::Body> = Client::builder().build(https);
let client: Client<_, Empty<Bytes>> = Client::builder(TokioExecutor::new()).build(https);

let res = client.get(url).await.unwrap();
assert_eq!(res.status(), StatusCode::OK);
Expand Down

0 comments on commit ca99f4c

Please sign in to comment.