[−][src]Crate roa_tls
This crate provides an acceptor implementing roa_core::Accept
and an app extension.
TlsIncoming
use roa_core::{App, Context, Error}; use roa_tls::{TlsIncoming, ServerConfig, NoClientAuth}; use roa_tls::internal::pemfile::{certs, rsa_private_keys}; use std::fs::File; use std::io::BufReader; async fn end(_ctx: &mut Context<()>) -> Result<(), Error> { Ok(()) } let mut config = ServerConfig::new(NoClientAuth::new()); let mut cert_file = BufReader::new(File::open("../assets/cert.pem")?); let mut key_file = BufReader::new(File::open("../assets/key.pem")?); let cert_chain = certs(&mut cert_file).unwrap(); let mut keys = rsa_private_keys(&mut key_file).unwrap(); config.set_single_cert(cert_chain, keys.remove(0))?; let incoming = TlsIncoming::bind("127.0.0.1:0", config)?; let server = App::new(()).end(end).accept(incoming); // server.await Ok(())
TlsListener
use roa_core::{App, Context, Error}; use roa_tls::{TlsListener, ServerConfig, NoClientAuth}; use roa_tls::internal::pemfile::{certs, rsa_private_keys}; use std::fs::File; use std::io::BufReader; async fn end(_ctx: &mut Context<()>) -> Result<(), Error> { Ok(()) } let mut config = ServerConfig::new(NoClientAuth::new()); let mut cert_file = BufReader::new(File::open("../assets/cert.pem")?); let mut key_file = BufReader::new(File::open("../assets/key.pem")?); let cert_chain = certs(&mut cert_file).unwrap(); let mut keys = rsa_private_keys(&mut key_file).unwrap(); config.set_single_cert(cert_chain, keys.remove(0))?; let (addr, server) = App::new(()).end(end).bind_tls("127.0.0.1:0", config)?; // server.await Ok(())
Modules
internal | Internal classes which may be useful outside the library. The contents of this section DO NOT form part of the stable interface. |
manual | This is the rustls manual. This documentation primarily aims to explain design decisions taken in rustls. |
sign | Message signing interfaces and implementations. |
Structs
AllowAnyAnonymousOrAuthenticatedClient | A |
AllowAnyAuthenticatedClient | A |
Certificate | This type contains a single certificate by value. |
ClientConfig | Common configuration for (typically) all connections made by a program. |
ClientHello | A struct representing the received Client Hello |
ClientSession | This represents a single TLS client session. |
ClientSessionMemoryCache | An implementor of |
KeyLogFile |
|
NoClientAuth | Turns off client authentication. |
NoClientSessionStorage | An implementor of |
NoKeyLog | KeyLog that does exactly nothing. |
NoServerSessionStorage | Something which never stores sessions. |
PrivateKey | This type contains a private key by value. |
ResolvesServerCertUsingSNI | Something that resolves do different cert chains/keys based on client-supplied server name (via SNI). |
RootCertStore | A container for root certificates able to provide a root-of-trust for connection authentication. |
ServerConfig | Common configuration for a set of server sessions. |
ServerSession | This represents a single TLS server session. |
ServerSessionMemoryCache | An implementor of |
Stream | This type implements |
StreamOwned | This type implements |
SupportedCipherSuite | A cipher suite supported by rustls. |
Ticketer | A concrete, safe ticket creation mechanism. |
TlsIncoming | A stream of connections from a TcpIncoming. As an implementation of roa_core::Accept. |
WriteEarlyData | Stub that implements io::Write and dispatches to |
WriteVAdapter | This is a simple wrapper around an object
which implements |
Enums
BulkAlgorithm | Bulk symmetric encryption scheme used by a cipher suite. |
CipherSuite | The |
ProtocolVersion | The |
SignatureScheme | The |
TLSError | rustls reports protocol errors using this type. |
WrapTlsStream | A finite-state machine to do tls handshake. |
Statics
ALL_CIPHERSUITES | A list of all the cipher suites supported by rustls. |
Traits
KeyLog | This trait represents the ability to do something useful with key material, such as logging it to a file for debugging. |
ProducesTickets | A trait for the ability to encrypt and decrypt tickets. |
ResolvesClientCert | A trait for the ability to choose a certificate chain and private key for the purposes of client authentication. |
ResolvesServerCert | How to choose a certificate chain and signing key for use in server authentication. |
Session | Generalises |
StoresClientSessions | A trait for the ability to store client session data. The keys and values are opaque. |
StoresServerSessions | A trait for the ability to store server session data. |
TlsListener | An app extension. |
WriteV | This trait specifies rustls's precise requirements doing writes with vectored IO. |
Type Definitions
DistinguishedNames |