Skip to content

Commit 1fd1b53

Browse files
committed
Fix client example
1 parent 78e8359 commit 1fd1b53

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

examples/client/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ futures-preview = "0.3.0-alpha.17"
99
async-std = { path = "../../../async-std" }
1010
structopt = "0.2"
1111
async-tls = { path = "../.." }
12-
webpki = "0.21.0"

examples/client/src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use async_tls::TlsConnector;
77
use futures::io::AsyncWriteExt;
88
use std::net::ToSocketAddrs;
99
use structopt::StructOpt;
10-
use webpki::DNSNameRef;
1110

1211
#[derive(StructOpt)]
1312
struct Options {
@@ -37,7 +36,7 @@ fn main() -> io::Result<()> {
3736
let domain = options.domain.unwrap_or(options.host);
3837

3938
// Create a bare bones HTTP GET request
40-
let http_request = format!("GET / HTTP/1.0\r\nHost: {}\r\n\r\n", domain_option);
39+
let http_request = format!("GET / HTTP/1.0\r\nHost: {}\r\n\r\n", domain);
4140

4241
// Create default connector comes preconfigured with all you need to safely connect
4342
// to remote servers!
@@ -51,7 +50,7 @@ fn main() -> io::Result<()> {
5150
// This might fail early if you pass an invalid domain,
5251
// which is why we use `?`.
5352
// This consumes the TCP stream to ensure you are not reusing it.
54-
let handshake = connector.connect(&domain_option, tcp_stream)?;
53+
let handshake = connector.connect(&domain, tcp_stream)?;
5554
// Awaiting the handshake gives you an encrypted
5655
// stream back which you can use like any other.
5756
let mut tls_stream = handshake.await?;

0 commit comments

Comments
 (0)