Expand description
Async TLS streams
§Examples
To connect as a client to a remote server:
use async_std::prelude::*;
use async_std::net::TcpStream;
let stream = TcpStream::connect("google.com:443").await?;
let mut stream = async_native_tls::connect("google.com", stream).await?;
stream.write_all(b"GET / HTTP/1.0\r\n\r\n").await?;
let mut res = Vec::new();
stream.read_to_end(&mut res).await?;
println!("{}", String::from_utf8_lossy(&res));
Structs§
- An X509 certificate.
- An error returned from the TLS implementation.
- The host part of a domain (without scheme, port and path).
- A cryptographic identity.
- A wrapper around a
native_tls::TlsAcceptor
, providing an asyncaccept
method. - Connect a client to a remote server.
- A stream managing a TLS session.
Enums§
- An error returned from creating an acceptor.
- SSL/TLS protocol versions.
Functions§
- One of accept of an incoming connection.
- Connect a client to a remote server.
Type Aliases§
- A typedef of the result-type returned by many methods.