An implementation of TLS/SSL streams for Tokio built on top of the [native-tls
crate]
Documentation
[native-tls
crate]: https://github.com/sfackler/rust-native-tls
First, add this to your Cargo.toml
:
[dependencies]
native-tls = "0.1"
tokio-tls = "0.1"
Next, add this to your crate:
extern crate native_tls;
extern crate tokio_tls;
use tokio_tls::{TlsConnectorExt, TlsAcceptorExt};
This crate provides two extension traits, TlsConnectorExt
and
TlsAcceptorExt
, which augment the functionality provided by the [native-tls
crate]. These extension traits provide the ability to connect a stream
asynchronously and accept a socket asynchronously. Configuration of TLS
parameters is still done through the support in the native-tls
crate.
By default the native-tls
crate currently uses the "platform appropriate"
backend for a TLS implementation. This means:
- On Windows, SChannel is used
- On OSX, SecureTransport is used
- Everywhere else, OpenSSL is used
Typically these selections mean that you don't have to worry about a portability when using TLS, these libraries are all normally installed by default.
tokio-tls
is primarily distributed under the terms of both the MIT license
and the Apache License (Version 2.0), with portions covered by various BSD-like
licenses.
See LICENSE-APACHE, and LICENSE-MIT for details.