File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -9,4 +9,3 @@ futures-preview = "0.3.0-alpha.17"
9
9
async-std = { path = " ../../../async-std" }
10
10
structopt = " 0.2"
11
11
async-tls = { path = " ../.." }
12
- webpki = " 0.21.0"
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ use async_tls::TlsConnector;
7
7
use futures:: io:: AsyncWriteExt ;
8
8
use std:: net:: ToSocketAddrs ;
9
9
use structopt:: StructOpt ;
10
- use webpki:: DNSNameRef ;
11
10
12
11
#[ derive( StructOpt ) ]
13
12
struct Options {
@@ -37,7 +36,7 @@ fn main() -> io::Result<()> {
37
36
let domain = options. domain . unwrap_or ( options. host ) ;
38
37
39
38
// Create a bare bones HTTP GET request
40
- let http_request = format ! ( "GET / HTTP/1.0\r \n Host: {}\r \n \r \n " , domain_option ) ;
39
+ let http_request = format ! ( "GET / HTTP/1.0\r \n Host: {}\r \n \r \n " , domain ) ;
41
40
42
41
// Create default connector comes preconfigured with all you need to safely connect
43
42
// to remote servers!
@@ -51,7 +50,7 @@ fn main() -> io::Result<()> {
51
50
// This might fail early if you pass an invalid domain,
52
51
// which is why we use `?`.
53
52
// 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) ?;
55
54
// Awaiting the handshake gives you an encrypted
56
55
// stream back which you can use like any other.
57
56
let mut tls_stream = handshake. await ?;
You can’t perform that action at this time.
0 commit comments