#tide #https #tls

tide-rustls

tide tls listener based on async-tls and rustls

4 releases

new 0.1.3 Oct 17, 2020
0.1.2 Sep 5, 2020
0.1.1 Jul 27, 2020
0.1.0 Jul 27, 2020

#138 in HTTP server

Download history 12/week @ 2020-07-21 20/week @ 2020-07-28 2/week @ 2020-08-04 9/week @ 2020-08-11 4/week @ 2020-08-18 8/week @ 2020-08-25 121/week @ 2020-09-01 13/week @ 2020-09-08 25/week @ 2020-09-15 48/week @ 2020-09-22 60/week @ 2020-09-29 43/week @ 2020-10-06 47/week @ 2020-10-13

127 downloads per month
Used in tide-serve

MIT/Apache

21KB
362 lines

Tide rustls listener

tls listener for tide based on async-tls and rustls

Installation

$ cargo add tide-rustls

Using with tide

#[async_std::main]
async fn main() -> tide::Result<()> {
    let mut app = tide::new();
    app.at("/").get(|_| async { Ok("Hello TLS") });
    app.listen(
        TlsListener::build()
            .addrs("localhost:4433")
            .cert(std::env::var("TIDE_CERT_PATH").unwrap())
            .key(std::env::var("TIDE_KEY_PATH").unwrap()),
        )
        .await?;
    Ok(())
}

Safety

This crate uses #![deny(unsafe_code)] to ensure everything is implemented in 100% Safe Rust.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~16MB
~381K SLoC