Skip to content

amqp-rs/rustls-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

178 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Docs Build status Downloads Dependency Status LICENSE

A TLS connector for rustls modelled after the openssl and native-tls APIs.

Wraps rustls with a high-level RustlsConnector type that mirrors the ergonomics of native_tls::TlsConnector, making it straightforward to swap TLS backends in existing code. An async variant is available via the futures feature.

Feature flags

Certificate store (pick at least one)

Flag Notes
platform-verifier (default) Platform trust store via rustls-platform-verifier
native-certs Native root certificates via rustls-native-certs
webpki-root-certs Bundled Mozilla root certificate set

Rustls crypto provider (at least one required)

Flag Notes
rustls--aws_lc_rs (default) Uses aws-lc-rs
rustls--ring Uses ring (more portable, e.g. builds on Windows)

Miscellaneous

Flag Notes
futures Async connect via futures-rustls
logging Enable rustls TLS logging

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));

About

Connector similar to openssl or native-tls for rustls

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Languages