#thin #wrapper #little #tls #listener #tokio-rustls #bit

tokio-tls-listener

Thin wrapper around tokio-rustls to make it a little easier to use

2 unstable releases

new 0.2.0 Jun 4, 2024
0.1.0 Jun 1, 2023

#5 in #tokio-rustls


Used in h2x

MIT license

6KB
101 lines

A thin wrapper around tokio-rustls to make it a little bit easier to use.

Example

use tokio_tls_listener::{TlsListener, tls_config};
async {
    let conf = tls_config("./cert.pem", "./key.pem").unwrap();
    let listener = TlsListener::bind("127.0.0.1:4433", conf).await.unwrap();
    loop {
        let Ok((stream, addr)) = listener.accept_tls().await else { continue };
        // ...
    }
};

Dependencies

~10–19MB
~330K SLoC