wolfcrypt-tls 0.1.0

Safe Rust TLS API backed by wolfSSL
docs.rs failed to build wolfcrypt-tls-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

Safe Rust TLS API backed by wolfSSL.

This crate provides idiomatic Rust types for TLS client and server connections, wrapping the wolfSSL C library's TLS implementation.

Quick start — TLS client

use wolfssl::{TlsClientConfig, TlsClient, RootCertStore};
use std::io::{Read, Write};
use std::net::TcpStream;

let mut root_store = RootCertStore::new();
// root_store.add_pem(include_bytes!("ca.pem"));

let config = TlsClientConfig::builder()
    .with_root_certificates(root_store)
    .with_no_client_auth()
    .build()
    .unwrap();

let stream = TcpStream::connect("example.com:443").unwrap();
let mut tls = TlsClient::new(config, "example.com", stream).unwrap();
tls.write_all(b"GET / HTTP/1.1\r\nHost: example.com\r\n\r\n").unwrap();

Blocking I/O

This crate currently targets blocking I/O only. Non-blocking transport support is planned for a future release.