Expand description
tide tls listener built on async-tls and rustls
§Example
fn main() -> tide::Result<()> { async_std::task::block_on(async {
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?;
Re-exports§
pub use async_rustls;
pub use rustls;
Structs§
- TlsListener
- The primary type for this crate
- TlsListener
Builder - A builder for TlsListeners
Traits§
- Custom
TlsAcceptor - The CustomTlsAcceptor trait provides a custom implementation of accepting
TLS connections from a
TcpStream
. tide-rustls will call theCustomTlsAcceptor::accept
function for each newTcpStream
it accepts, to obtain aTlsStream
).