rustls/rustls
Security & PrivacyA Rust TLS library for clients and servers that defaults to safe configuration and selectable crypto providers.
What it is
Rustls is a TLS library written in Rust for both clients and servers. It implements TLS 1.2 and TLS 1.3 and is designed so that a secure configuration is the default: there are no unsafe features or obsolete cryptography enabled out of the box. The API is intended to stay reasonably stable but may evolve for new features and performance work; the project publishes a roadmap and benchmarks.
It suits Rust developers who need to add TLS to a network client, server, or protocol implementation without depending on OpenSSL. All TLS logic is in Rust, while the cryptographic primitives come from a pluggable provider.
Quick start
Use the crate as a library dependency and start from the example programs in the repository. For a direct client test against a public site:
cargo run --bin tls-client-mio -- --http jbp.io
The program prints the HTTP response, for example a 200 OK with headers and body. For the server side, the README starts a TLS echo server with a test certificate and key, then checks it with both openssl s_client and tls-client-mio:
cargo run --bin tls-server-mio -- --certs test-ca/rsa-2048/end.fullchain --key test-ca/rsa-2048/end.key -p 8443 echo &
echo hello world | openssl s_client -ign_eof -quiet -connect localhost:8443
echo hello world | cargo run --bin tls-client-mio -- --cafile test-ca/rsa-2048/ca.cert --port 8443 localhost
Both commands return hello world. Use --help on either example binary for more options. The MIO examples are the most complete; if you already use Tokio, tokio-rustls is the more natural integration point, and simpler client/server examples are available for newcomers. API documentation is on docs.rs, and release notes are listed on the releases page.
Crypto providers
A CryptoProvider supplies the cryptographic primitives used by the TLS implementation. Since Rustls 0.24, callers must explicitly provide a provider when constructing ClientConfig or ServerConfig. The project maintains two first-party providers: rustls-aws-lc-rs, which offers high performance and a complete feature set including post-quantum algorithms, and rustls-ring, which is easier to build on many platforms but has a more limited feature set. The team recommends rustls-aws-lc-rs; the aws-lc-rs FAQ documents platform and architecture constraints. Third-party providers such as rustls-graviola (Graviola) and rustls-symcrypt (Microsoft SymCrypt) are also available, and PROVIDERS.md lists more. Custom providers can be written for specific platform, compliance, or portability needs.
Constraints
Rustls is platform independent, but the chosen crypto provider determines build and architecture support. The aws-lc-rs provider can be harder to build on some platforms; select ring or a third-party provider where that matters. Because 0.24 requires an explicit provider, code written for earlier versions that relied on Cargo features to choose a provider needs to be updated when upgrading. The crate is distributed under Apache 2.0, MIT, or ISC, at your option.
HotRepo's take
Rustls has no recorded all-language daily rank, but on the Rust daily list for 2026-12-04 it held a best position of 7 with 22 stars gained, alongside 7,894 stars and 968 forks overall. That single snapshot shows a mature library still attracting same-day attention within the Rust ecosystem; the available record is not enough to describe a longer trend. Its practical distinction is the provider boundary: TLS behavior stays in Rust, while crypto backends can be swapped for performance, compliance, or platform reasons.
Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.