Async TLS for the Tokio runtime
examples | ||
src | ||
.gitignore | ||
.gitjournal.toml | ||
Cargo.toml | ||
LICENSE-APACHE | ||
LICENSE-MIT | ||
README.md |
tokio-rustls
exmaple
// ...
use rustls::ClientConfig;
use tokio_rustls::ClientConfigExt;
let mut config = ClientConfig::new();
config.root_store.add_trust_anchors(&webpki_roots::ROOTS);
let config = Arc::new(config);
TcpStream::connect(&addr, &handle)
.and_then(|socket| config.connect_async("www.rust-lang.org", socket))
// ...