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.
wolfcrypt-tls
Safe Rust TLS client and server backed by wolfSSL.
Published as the wolfssl crate (lib.name = "wolfssl").
Why
wolfSSL is a FIPS 140-3 validated TLS library used in billions of embedded and
server deployments. wolfcrypt-tls gives you:
- FIPS 140-3 — TLS with a validated crypto backend for regulated environments (commercial license required; contact wolfSSL)
- Small footprint — designed for embedded targets alongside full server deployments; a single dependency chain, no OpenSSL
- Familiar Rust API —
TlsClient/TlsServertypes that wrap standardstd::io::Read + Writestreams - Async-ready — config types expose raw
WOLFSSL_CTXandWOLFSSLpointers and a session builder with custom IO callbacks, so async runtimes (e.g.wolfcrypt-tls-tokio) can build on top without duplicating cert/key loading logic
Usage
[]
= "0.1"
TLS client
use ;
use ;
use TcpStream;
let mut roots = new;
roots.add_pem;
let config = builder
.with_root_certificates
.with_no_client_auth
.build?;
let stream = connect?;
let mut tls = new?;
tls.write_all?;
let mut buf = ;
let n = tls.read?;
TLS server
use ;
use TcpListener;
let config = builder
.with_certificate_chain
.with_no_client_auth
.build?;
let acceptor = new;
let listener = bind?;
for stream in listener.incoming
Mutual TLS (mTLS)
// Server: require client certificates
let config = builder
.with_certificate_chain
.with_client_auth
.build?;
// Client: present a certificate
let config = builder
.with_root_certificates
.with_client_auth
.build?;
Protocol version control
use ProtocolVersion;
let config = builder
.with_root_certificates
.with_no_client_auth
.with_protocol_versions
.build?;
How it works
wolfssl-src Compiles wolfSSL C source via the cc crate
│
wolfcrypt-sys bindgen FFI bindings to wolfSSL
│
wolfcrypt-tls Safe TlsClient / TlsServer API (this crate)
Exported as lib.name = "wolfssl"
TlsClientConfig and TlsServerConfig wrap WOLFSSL_CTX in an
Arc-backed RAII type. TlsClient and TlsServer wrap WOLFSSL session
objects and implement Read + Write. The underlying transport is plugged in
via wolfSSL_set_fd; any type implementing AsRawFd (Unix) or
AsRawSocket (Windows) works.
For async runtimes that cannot hand wolfSSL a raw file descriptor, the config
types expose new_ssl_with_io_callbacks — a session builder that wires custom
recv/send callbacks and returns an owned *mut WOLFSSL. See
wolfcrypt-tls-tokio for the tokio async layer built on this API.
Features
| Feature | Description |
|---|---|
vendored |
Compile wolfSSL from source (requires WOLFSSL_SRC or pkg-config) |
fips |
Enable the wolfSSL FIPS 140-3 code path |
FIPS 140-3 validated builds require a wolfSSL commercial license and the validated source tree. Contact wolfSSL for a commercial FIPS license. See the workspace README for details.
Status
- TLS 1.2 and TLS 1.3
- Client and server, including mutual TLS (mTLS)
- Blocking I/O over any
Read + Write + AsRawFdtransport - Async IO callback API for building async adapters
- Unix and Windows socket support
Copyright
Copyright (C) 2006-2026 wolfSSL Inc.
License
GPL-3.0-only OR LicenseRef-wolfSSL-commercial — see LICENSE.
The underlying wolfSSL C library is licensed under GPL-2.0-or-later with a commercial option available from wolfSSL Inc.