This repository has been archived by the owner. It is now read-only.
An implementation of TLS/SSL streams for Tokio
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

This repository is deprecated!

This crate has moved to


An implementation of TLS/SSL streams for Tokio built on top of the native-tls crate

Build Status Build status



First, add this to your Cargo.toml:

native-tls = "0.2"
tokio-tls = "0.2"

Next, add this to your crate:

extern crate native_tls;
extern crate tokio_tls;

use tokio_tls::{TlsConnectorExt, TlsAcceptorExt};

You can find few examples how to use this crate in examples directory (using TLS in hyper server or client).

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:

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.


This project is licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in tokio-tls by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.