Skip to content

Commit

Permalink
Merge pull request #22 from hjr3/hyper-tls
Browse files Browse the repository at this point in the history
Update to hyper-tls 0.5
  • Loading branch information
hjr3 authored Jan 2, 2021
2 parents f2ba820 + b5d00fd commit 1f9f8a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ tokio-io-timeout = "1.1.0"

[dev-dependencies]
hyper = { version = "0.14", features = ["client", "http1", "tcp"] }
#FIXME enable when https://github.com/hyperium/hyper-tls/pull/79 lands
#hyper-tls = "0.4"
hyper-tls = "0.5"
tokio = { version = "1.0.0", features = ["io-std", "io-util", "macros"] }
7 changes: 3 additions & 4 deletions examples/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use std::time::Duration;
use hyper::{body::HttpBody as _, Client};
use tokio::io::{self, AsyncWriteExt as _};

use hyper::client::HttpConnector;
//use hyper_tls::HttpsConnector;
use hyper_tls::HttpsConnector;

use hyper_timeout::TimeoutConnector;

Expand All @@ -23,8 +22,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let url = url.parse::<hyper::Uri>().unwrap();

// This example uses `HttpsConnector`, but you can also use hyper `HttpConnector`
let h = HttpConnector::new();
//let h = HttpsConnector::new();
//let h = hyper::client::HttpConnector::new();
let h = HttpsConnector::new();
let mut connector = TimeoutConnector::new(h);
connector.set_connect_timeout(Some(Duration::from_secs(5)));
connector.set_read_timeout(Some(Duration::from_secs(5)));
Expand Down

0 comments on commit 1f9f8a1

Please sign in to comment.