Skip to content

A TLS implementation over AsyncRead and AsyncWrite

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Michael-F-Bryan/async-tls

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

async-tls

license license docs.rs

Asynchronous TLS/SSL streams using Rustls.

Simple Client

use async_tls::TlsConnector;
use async_std::net::TcpStream;

// ...

let tcp_stream = TcpStream::connect("rust-lang.org:443").await?;
let connector = TlsConnector::default();
let handshake = connector::connect("www.rust-lang.org", tcp_stream)?;
let mut tls_stream = handshake.await?;

// ...

Client Example Program

See examples/client. You can run it with:

cd examples/client
cargo run -- hsts.badssl.com

Server Example Program

See examples/server. You can run it with:

cd examples/server
cargo run -- 127.0.0.1:8080 --cert ../../tests/end.cert --key ../../tests/end.rsa 

and point the client at it with:

cd examples/client
cargo run -- 127.0.0.1 --port 8080 --domain localhost --cafile ../../tests/end.chain

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

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.

About

A TLS implementation over AsyncRead and AsyncWrite

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%