Rust bindings for [LibreSSL]'s [libtls] library.

>

NOTE: THIS CRATE IS UNDER ACTIVE DEVELOPMENT AND WORK IN PROGRESS. !!!DO NOT USE IT YET!!!

Crates.IO Build Status License

Documentation.

The [LibreSSL] project provides a free TLS and crypto stack that was forked from [OpenSSL] in 2014. The goals are to provide a modernized codebase, improved security, and to apply best practice development processes.

[LibreSSL] provides C APIs that are compatible to [OpenSSL]'s [libssl] and [libcrypto] libraries. It also provides [libtls], a new TLS library that is designed to make it easier to write foolproof applications.

This crate provides Rust language bindings for [libtls] only, as the other [LibreSSL] APIs can be used with the existing [rust-openssl] crate. [LibreSSL] versions 2.9.0 through 3.0.2 (or later) are supported.

Examples

```rust use libtls::config::{self, TlsConfig}; use libtls::error;

fn tlsserverconfig() -> error::Result { let mut tlsconfig = TlsConfig::new()?; tlsconfig.setkeypairfile("tests/eccert.crt", "tests/eccert.key")?; tlsconfig.setprotocols(libtlssys::TLSPROTOCOLTLSv12); Ok(tls_config) }

fn main() { let tlsconfig = tlsserver_config().unwrap(); } ```

The same configuration can be created using the TlsConfigBuilder builder pattern:

rust fn tls_server_config() -> error::Result<TlsConfig> { let tls_config = TlsConfigBuilder::new() .keypair_file("tests/eccert.crt", "tests/eccert.key", None) .protocols(libtls_sys::TLS_PROTOCOL_TLSv1_2) .build()?; Ok(tls_config) }

Copyright and license

Licensed under an OpenBSD-ISC-style license, see [LICENSE] for details.