Crate web3_async_native_tls[][src]

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

Certificate

An X509 certificate.

Error

An error returned from the TLS implementation.

Host

The host part of a domain (without scheme, port and path).

Identity

A cryptographic identity.

TlsAcceptor

A wrapper around a native_tls::TlsAcceptor, providing an async accept method.

TlsConnector

Connect a client to a remote server.

TlsStream

A stream managing a TLS session.

Enums

AcceptError

An error returned from creating an acceptor.

Protocol

SSL/TLS protocol versions.

Functions

accept

One of accept of an incoming connection.

connect

Connect a client to a remote server.

Type Definitions

Result

A typedef of the result-type returned by many methods.