An implementation of TLS/SSL streams for Tokio built on top of the [native-tls
crate]
First, add this to your Cargo.toml
:
toml
[dependencies]
native-tls = "0.1"
tokio-tls = "0.1"
Next, add this to your crate:
```rust extern crate nativetls; extern crate tokiotls;
use tokio_tls::{TlsConnectorExt, TlsAcceptorExt}; ```
You can find an example of using this crate at [https://tokio.rs] along with a detailed explanation of what's happening.
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.
tokio-proto
If you're working with a protocol that starts out with a TLS negotation on
either the client or server side then you can use the proto::Client
and
proto::Server
types in this crate for performing those tasks. To do so, you
can update your dependency as such:
toml
[dependencies]
tokio-tls = { version = "0.1", features = ["tokio-proto"] }
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Serde by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.