7 unstable releases

Uses new Rust 2024

new 0.5.0-rc.1 Apr 8, 2026
0.4.0 Apr 4, 2024
0.3.3 Apr 4, 2024
0.3.2 Jan 2, 2024
0.1.0 Jun 7, 2021

#6 in #framework-trillium


Used in trillium-cli

MIT/Apache

115KB
2K SLoC

🔐 trillium-native-tls — TLS via native-tls

ci crates.io version docs.rs

TLS adapter for Trillium using native-tls, which delegates to the platform's built-in TLS implementation (SChannel on Windows, Secure Transport on macOS, OpenSSL on Linux). Provides NativeTlsAcceptor for servers and NativeTlsClientTransport for clients.

Example

use trillium::Conn;
use trillium_native_tls::NativeTlsAcceptor;

fn main() {
    let identity = std::fs::read("identity.p12").unwrap();
    let acceptor = NativeTlsAcceptor::from_pkcs12(&identity, "password");
    trillium_smol::config()
        .with_acceptor(acceptor)
        .run(|conn: Conn| async move { conn.ok("https works") });
}

Safety

This crate uses #![forbid(unsafe_code)].

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

~8–17MB
~363K SLoC