58 releases
Uses new Rust 2024
| new 0.23.2 | May 11, 2026 |
|---|---|
| 0.23.0 | Apr 18, 2026 |
| 0.22.0 | Aug 19, 2025 |
| 0.21.7 | May 10, 2025 |
| 0.7.0 | Jun 10, 2019 |
#715 in Network programming
656,746 downloads per month
Used in 27 crates
(10 directly)
21KB
267 lines
Rustls certificates store
- platform-verifier (default)
- native-certs
- webpki-root-certs
Warning about crypto backends for rustls
A crypto implementation must be enabled in rustls using feature flags. We mimic what rustls does, providing one feature flag per implementation and enabling the same as rustls by default. Available options are:
rustls--aws_lc_rs(default)rustls--ring
Example
To connect to a remote server:
use rustls_connector::RustlsConnector;
use std::{
io::{Read, Write},
net::TcpStream,
};
let connector = RustlsConnector::new_with_platform_verifier().unwrap();
let stream = TcpStream::connect("google.com:443").unwrap();
let mut stream = connector.connect("google.com", stream).unwrap();
stream.write_all(b"GET / HTTP/1.0\r\n\r\n").unwrap();
let mut res = vec![];
stream.read_to_end(&mut res).unwrap();
println!("{}", String::from_utf8_lossy(&res));
Dependencies
~7–27MB
~538K SLoC