Features
async-tls
can be used both in server and client programs. To save compilation times, you
can switch off parts of this for faster compile times.
To only use async-tls on a client, deactivate default features and use the "client" feature.
[]
= "0.8"
= false
= ["client"]
To only use async-tls on for the server side, deactivate default features and use the "server" feature.
[]
= "0.8"
= false
= ["server"]
Simple Client
use TlsConnector;
use TcpStream;
// ...
let tcp_stream = connect.await?;
let connector = default;
let mut tls_stream = connector.connect.await?;
// ...
Client Example Program
See examples/client. You can run it with:
Server Example Program
See examples/server. You can run it with:
and point the client at it with:
NOTE: Don't ever use those certificate files anywhere but for testing!
Safety
This crate uses #![deny(unsafe_code)]
to ensure everything is implemented in
100% Safe Rust.
License & Origin
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
This started as a fork of tokio-rustls.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in async-tls by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.