mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-25 12:44:07 +01:00
224 lines
34 KiB
HTML
224 lines
34 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Rustls - a modern TLS library"><title>rustls - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="rustls" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../rustls/index.html">rustls</a><span class="version">0.21.7</span></h2></div><div class="sidebar-elems"><ul class="block">
|
||
<li><a id="all-types" href="all.html">All Items</a></li></ul><section><ul class="block"><li><a href="#reexports">Re-exports</a></li><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#statics">Statics</a></li><li><a href="#traits">Traits</a></li></ul></section></div></nav><div class="sidebar-resizer"></div>
|
||
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../rustls/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Crate <a class="mod" href="#">rustls</a><button id="copy-path" title="Copy item path to clipboard"><img src="../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../src/rustls/lib.rs.html#1-526">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><h2 id="rustls---a-modern-tls-library"><a href="#rustls---a-modern-tls-library">Rustls - a modern TLS library</a></h2>
|
||
<p>Rustls is a TLS library that aims to provide a good level of cryptographic security,
|
||
requires no configuration to achieve that security, and provides no unsafe features or
|
||
obsolete cryptography.</p>
|
||
<h3 id="current-features"><a href="#current-features">Current features</a></h3>
|
||
<ul>
|
||
<li>TLS1.2 and TLS1.3.</li>
|
||
<li>ECDSA, Ed25519 or RSA server authentication by clients.</li>
|
||
<li>ECDSA, Ed25519 or RSA server authentication by servers.</li>
|
||
<li>Forward secrecy using ECDHE; with curve25519, nistp256 or nistp384 curves.</li>
|
||
<li>AES128-GCM and AES256-GCM bulk encryption, with safe nonces.</li>
|
||
<li>ChaCha20-Poly1305 bulk encryption (<a href="https://tools.ietf.org/html/rfc7905">RFC7905</a>).</li>
|
||
<li>ALPN support.</li>
|
||
<li>SNI support.</li>
|
||
<li>Tunable fragment size to make TLS messages match size of underlying transport.</li>
|
||
<li>Optional use of vectored IO to minimise system calls.</li>
|
||
<li>TLS1.2 session resumption.</li>
|
||
<li>TLS1.2 resumption via tickets (<a href="https://tools.ietf.org/html/rfc5077">RFC5077</a>).</li>
|
||
<li>TLS1.3 resumption via tickets or session storage.</li>
|
||
<li>TLS1.3 0-RTT data for clients.</li>
|
||
<li>TLS1.3 0-RTT data for servers.</li>
|
||
<li>Client authentication by clients.</li>
|
||
<li>Client authentication by servers.</li>
|
||
<li>Extended master secret support (<a href="https://tools.ietf.org/html/rfc7627">RFC7627</a>).</li>
|
||
<li>Exporters (<a href="https://tools.ietf.org/html/rfc5705">RFC5705</a>).</li>
|
||
<li>OCSP stapling by servers.</li>
|
||
<li>SCT stapling by servers.</li>
|
||
<li>SCT verification by clients.</li>
|
||
</ul>
|
||
<h3 id="possible-future-features"><a href="#possible-future-features">Possible future features</a></h3>
|
||
<ul>
|
||
<li>PSK support.</li>
|
||
<li>OCSP verification by clients.</li>
|
||
<li>Certificate pinning.</li>
|
||
</ul>
|
||
<h3 id="non-features"><a href="#non-features">Non-features</a></h3>
|
||
<p>For reasons <a href="manual/index.html" title="mod rustls::manual">explained in the manual</a>,
|
||
rustls does not and will not support:</p>
|
||
<ul>
|
||
<li>SSL1, SSL2, SSL3, TLS1 or TLS1.1.</li>
|
||
<li>RC4.</li>
|
||
<li>DES or triple DES.</li>
|
||
<li>EXPORT ciphersuites.</li>
|
||
<li>MAC-then-encrypt ciphersuites.</li>
|
||
<li>Ciphersuites without forward secrecy.</li>
|
||
<li>Renegotiation.</li>
|
||
<li>Kerberos.</li>
|
||
<li>Compression.</li>
|
||
<li>Discrete-log Diffie-Hellman.</li>
|
||
<li>Automatic protocol version downgrade.</li>
|
||
</ul>
|
||
<p>There are plenty of other libraries that provide these features should you
|
||
need them.</p>
|
||
<h4 id="platform-support"><a href="#platform-support">Platform support</a></h4>
|
||
<p>While Rustls itself is platform independent it uses
|
||
<a href="https://crates.io/crates/ring"><code>ring</code></a> for implementing the cryptography in
|
||
TLS. As a result, rustls only runs on platforms
|
||
supported by <code>ring</code>. At the time of writing this means x86, x86-64, armv7, and
|
||
aarch64. For more information see <a href="https://github.com/briansmith/ring/blob/9cc0d45f4d8521f467bb3a621e74b1535e118188/.github/workflows/ci.yml#L151-L167">the supported <code>ring</code> CI
|
||
targets</a>.</p>
|
||
<p>Rustls requires Rust 1.60 or later.</p>
|
||
<h3 id="design-overview"><a href="#design-overview">Design Overview</a></h3><h4 id="rustls-does-not-take-care-of-network-io"><a href="#rustls-does-not-take-care-of-network-io">Rustls does not take care of network IO</a></h4>
|
||
<p>It doesn’t make or accept TCP connections, or do DNS, or read or write files.</p>
|
||
<p>There’s example client and server code which uses mio to do all needed network
|
||
IO.</p>
|
||
<h4 id="rustls-provides-encrypted-pipes"><a href="#rustls-provides-encrypted-pipes">Rustls provides encrypted pipes</a></h4>
|
||
<p>These are the <a href="server/struct.ServerConnection.html" title="struct rustls::server::ServerConnection"><code>ServerConnection</code></a> and <a href="client/struct.ClientConnection.html" title="struct rustls::client::ClientConnection"><code>ClientConnection</code></a> types. You supply raw TLS traffic
|
||
on the left (via the <a href="enum.Connection.html#method.read_tls" title="method rustls::Connection::read_tls"><code>read_tls()</code></a> and <a href="enum.Connection.html#method.read_tls" title="method rustls::Connection::read_tls"><code>write_tls()</code></a> methods) and then read/write the
|
||
plaintext on the right:</p>
|
||
<div class="example-wrap"><pre class="language-text"><code> TLS Plaintext
|
||
=== =========
|
||
read_tls() +-----------------------+ reader() as io::Read
|
||
| |
|
||
+---------> ClientConnection +--------->
|
||
| or |
|
||
<---------+ ServerConnection <---------+
|
||
| |
|
||
write_tls() +-----------------------+ writer() as io::Write
|
||
</code></pre></div><h4 id="rustls-takes-care-of-server-certificate-verification"><a href="#rustls-takes-care-of-server-certificate-verification">Rustls takes care of server certificate verification</a></h4>
|
||
<p>You do not need to provide anything other than a set of root certificates to trust.
|
||
Certificate verification cannot be turned off or disabled in the main API.</p>
|
||
<h3 id="getting-started"><a href="#getting-started">Getting started</a></h3>
|
||
<p>This is the minimum you need to do to make a TLS client connection.</p>
|
||
<p>First we load some root certificates. These are used to authenticate the server.
|
||
The recommended way is to depend on the <code>webpki_roots</code> crate which contains
|
||
the Mozilla set of root certificates.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span><span class="kw-2">mut </span>root_store = rustls::RootCertStore::empty();
|
||
root_store.add_trust_anchors(
|
||
webpki_roots::TLS_SERVER_ROOTS
|
||
.iter()
|
||
.map(|ta| {
|
||
rustls::OwnedTrustAnchor::from_subject_spki_name_constraints(
|
||
ta.subject,
|
||
ta.spki,
|
||
ta.name_constraints,
|
||
)
|
||
})
|
||
);</code></pre></div>
|
||
<p>Next, we make a <code>ClientConfig</code>. You’re likely to make one of these per process,
|
||
and use it for all connections made by that process.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>config = rustls::ClientConfig::builder()
|
||
.with_safe_defaults()
|
||
.with_root_certificates(root_store)
|
||
.with_no_client_auth();</code></pre></div>
|
||
<p>Now we can make a connection. You need to provide the server’s hostname so we
|
||
know what to expect to find in the server’s certificate.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let </span>rc_config = Arc::new(config);
|
||
<span class="kw">let </span>example_com = <span class="string">"example.com"</span>.try_into().unwrap();
|
||
<span class="kw">let </span><span class="kw-2">mut </span>client = rustls::ClientConnection::new(rc_config, example_com);</code></pre></div>
|
||
<p>Now you should do appropriate IO for the <code>client</code> object. If <code>client.wants_read()</code> yields
|
||
true, you should call <code>client.read_tls()</code> when the underlying connection has data.
|
||
Likewise, if <code>client.wants_write()</code> yields true, you should call <code>client.write_tls()</code>
|
||
when the underlying connection is able to send data. You should continue doing this
|
||
as long as the connection is valid.</p>
|
||
<p>The return types of <code>read_tls()</code> and <code>write_tls()</code> only tell you if the IO worked. No
|
||
parsing or processing of the TLS messages is done. After each <code>read_tls()</code> you should
|
||
therefore call <code>client.process_new_packets()</code> which parses and processes the messages.
|
||
Any error returned from <code>process_new_packets</code> is fatal to the connection, and will tell you
|
||
why. For example, if the server’s certificate is expired <code>process_new_packets</code> will
|
||
return <code>Err(InvalidCertificate(Expired))</code>. From this point on,
|
||
<code>process_new_packets</code> will not do any new work and will return that error continually.</p>
|
||
<p>You can extract newly received data by calling <code>client.reader()</code> (which implements the
|
||
<code>io::Read</code> trait). You can send data to the peer by calling <code>client.writer()</code> (which
|
||
implements <code>io::Write</code> trait). Note that <code>client.writer().write()</code> buffers data you
|
||
send if the TLS connection is not yet established: this is useful for writing (say) a
|
||
HTTP request, but this is buffered so avoid large amounts of data.</p>
|
||
<p>The following code uses a fictional socket IO API for illustration, and does not handle
|
||
errors.</p>
|
||
|
||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>std::io;
|
||
<span class="kw">use </span>rustls::Connection;
|
||
|
||
client.writer().write(<span class="string">b"GET / HTTP/1.0\r\n\r\n"</span>).unwrap();
|
||
<span class="kw">let </span><span class="kw-2">mut </span>socket = connect(<span class="string">"example.com"</span>, <span class="number">443</span>);
|
||
<span class="kw">loop </span>{
|
||
<span class="kw">if </span>client.wants_read() && socket.ready_for_read() {
|
||
client.read_tls(<span class="kw-2">&mut </span>socket).unwrap();
|
||
client.process_new_packets().unwrap();
|
||
|
||
<span class="kw">let </span><span class="kw-2">mut </span>plaintext = Vec::new();
|
||
client.reader().read_to_end(<span class="kw-2">&mut </span>plaintext).unwrap();
|
||
io::stdout().write(<span class="kw-2">&</span>plaintext).unwrap();
|
||
}
|
||
|
||
<span class="kw">if </span>client.wants_write() && socket.ready_for_write() {
|
||
client.write_tls(<span class="kw-2">&mut </span>socket).unwrap();
|
||
}
|
||
|
||
socket.wait_for_something_to_happen();
|
||
}</code></pre></div>
|
||
<h2 id="examples"><a href="#examples">Examples</a></h2>
|
||
<p><a href="https://github.com/rustls/rustls/blob/main/examples/src/bin/tlsserver-mio.rs"><code>tlsserver</code></a>
|
||
and <a href="https://github.com/rustls/rustls/blob/main/examples/src/bin/tlsclient-mio.rs"><code>tlsclient</code></a>
|
||
are full worked examples. These both use mio.</p>
|
||
<h2 id="crate-features"><a href="#crate-features">Crate features</a></h2>
|
||
<p>Here’s a list of what features are exposed by the rustls crate and what
|
||
they mean.</p>
|
||
<ul>
|
||
<li>
|
||
<p><code>logging</code>: this makes the rustls crate depend on the <code>log</code> crate.
|
||
rustls outputs interesting protocol-level messages at <code>trace!</code> and <code>debug!</code>
|
||
level, and protocol-level errors at <code>warn!</code> and <code>error!</code> level. The log
|
||
messages do not contain secret key data, and so are safe to archive without
|
||
affecting session security. This feature is in the default set.</p>
|
||
</li>
|
||
<li>
|
||
<p><code>dangerous_configuration</code>: this feature enables a <code>dangerous()</code> method on
|
||
<code>ClientConfig</code> and <code>ServerConfig</code> that allows setting inadvisable options,
|
||
such as replacing the certificate verification process. Applications
|
||
requesting this feature should be reviewed carefully.</p>
|
||
</li>
|
||
<li>
|
||
<p><code>quic</code>: this feature exposes additional constructors and functions
|
||
for using rustls as a TLS library for QUIC. See the <code>quic</code> module for
|
||
details of these. You will only need this if you’re writing a QUIC
|
||
implementation.</p>
|
||
</li>
|
||
<li>
|
||
<p><code>tls12</code>: enables support for TLS version 1.2. This feature is in the default
|
||
set. Note that, due to the additive nature of Cargo features and because it
|
||
is enabled by default, other crates in your dependency graph could re-enable
|
||
it for your application. If you want to disable TLS 1.2 for security reasons,
|
||
consider explicitly enabling TLS 1.3 only in the config builder API.</p>
|
||
</li>
|
||
<li>
|
||
<p><code>read_buf</code>: When building with Rust Nightly, adds support for the unstable
|
||
<code>std::io::ReadBuf</code> and related APIs. This reduces costs from initializing
|
||
buffers. Will do nothing on non-Nightly releases.</p>
|
||
</li>
|
||
</ul>
|
||
</div></details><h2 id="reexports" class="section-header"><a href="#reexports">Re-exports</a></h2><ul class="item-table"><li><div class="item-name" id="reexport.ClientConfig"><code>pub use client::<a class="struct" href="client/struct.ClientConfig.html" title="struct rustls::client::ClientConfig">ClientConfig</a>;</code></div></li><li><div class="item-name" id="reexport.ClientConnection"><code>pub use client::<a class="struct" href="client/struct.ClientConnection.html" title="struct rustls::client::ClientConnection">ClientConnection</a>;</code></div></li><li><div class="item-name" id="reexport.ServerName"><code>pub use client::<a class="enum" href="client/enum.ServerName.html" title="enum rustls::client::ServerName">ServerName</a>;</code></div></li><li><div class="item-name" id="reexport.ServerConfig"><code>pub use server::<a class="struct" href="server/struct.ServerConfig.html" title="struct rustls::server::ServerConfig">ServerConfig</a>;</code></div></li><li><div class="item-name" id="reexport.ServerConnection"><code>pub use server::<a class="struct" href="server/struct.ServerConnection.html" title="struct rustls::server::ServerConnection">ServerConnection</a>;</code></div></li></ul><h2 id="modules" class="section-header"><a href="#modules">Modules</a></h2><ul class="item-table"><li><div class="item-name"><a class="mod" href="cipher_suite/index.html" title="mod rustls::cipher_suite">cipher_suite</a></div><div class="desc docblock-short">All defined ciphersuites appear in this module.</div></li><li><div class="item-name"><a class="mod" href="client/index.html" title="mod rustls::client">client</a></div><div class="desc docblock-short">Items for use in a client.</div></li><li><div class="item-name"><a class="mod" href="internal/index.html" title="mod rustls::internal">internal</a></div><div class="desc docblock-short">Internal classes which may be useful outside the library.
|
||
The contents of this section DO NOT form part of the stable interface.</div></li><li><div class="item-name"><a class="mod" href="kx_group/index.html" title="mod rustls::kx_group">kx_group</a></div><div class="desc docblock-short">All defined key exchange groups appear in this module.</div></li><li><div class="item-name"><a class="mod" href="manual/index.html" title="mod rustls::manual">manual</a></div><div class="desc docblock-short">This is the rustls manual.</div></li><li><div class="item-name"><a class="mod" href="server/index.html" title="mod rustls::server">server</a></div><div class="desc docblock-short">Items for use in a server.</div></li><li><div class="item-name"><a class="mod" href="sign/index.html" title="mod rustls::sign">sign</a></div><div class="desc docblock-short">Message signing interfaces and implementations.</div></li><li><div class="item-name"><a class="mod" href="version/index.html" title="mod rustls::version">version</a></div><div class="desc docblock-short">All defined protocol versions appear in this module.</div></li></ul><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.Certificate.html" title="struct rustls::Certificate">Certificate</a></div><div class="desc docblock-short">This type contains a single certificate by value.</div></li><li><div class="item-name"><a class="struct" href="struct.CommonState.html" title="struct rustls::CommonState">CommonState</a></div><div class="desc docblock-short">Connection state common to both client and server connections.</div></li><li><div class="item-name"><a class="struct" href="struct.ConfigBuilder.html" title="struct rustls::ConfigBuilder">ConfigBuilder</a></div><div class="desc docblock-short">Building a <a href="server/struct.ServerConfig.html" title="struct rustls::server::ServerConfig"><code>ServerConfig</code></a> or <a href="client/struct.ClientConfig.html" title="struct rustls::client::ClientConfig"><code>ClientConfig</code></a> in a linker-friendly and
|
||
complete way.</div></li><li><div class="item-name"><a class="struct" href="struct.ConnectionCommon.html" title="struct rustls::ConnectionCommon">ConnectionCommon</a></div><div class="desc docblock-short">Interface shared by client and server connections.</div></li><li><div class="item-name"><a class="struct" href="struct.DigitallySignedStruct.html" title="struct rustls::DigitallySignedStruct">DigitallySignedStruct</a></div><div class="desc docblock-short">This type combines a <a href="enum.SignatureScheme.html" title="enum rustls::SignatureScheme"><code>SignatureScheme</code></a> and a signature payload produced with that scheme.</div></li><li><div class="item-name"><a class="struct" href="struct.DistinguishedName.html" title="struct rustls::DistinguishedName">DistinguishedName</a></div><div class="desc docblock-short">A <code>DistinguishedName</code> is a <code>Vec<u8></code> wrapped in internal types.</div></li><li><div class="item-name"><a class="struct" href="struct.IoState.html" title="struct rustls::IoState">IoState</a></div><div class="desc docblock-short">Values of this structure are returned from <a href="enum.Connection.html#method.process_new_packets" title="method rustls::Connection::process_new_packets"><code>Connection::process_new_packets</code></a>
|
||
and tell the caller the current I/O state of the TLS connection.</div></li><li><div class="item-name"><a class="struct" href="struct.KeyLogFile.html" title="struct rustls::KeyLogFile">KeyLogFile</a></div><div class="desc docblock-short"><a href="trait.KeyLog.html" title="trait rustls::KeyLog"><code>KeyLog</code></a> implementation that opens a file whose name is
|
||
given by the <code>SSLKEYLOGFILE</code> environment variable, and writes
|
||
keys into it.</div></li><li><div class="item-name"><a class="struct" href="struct.NoKeyLog.html" title="struct rustls::NoKeyLog">NoKeyLog</a></div><div class="desc docblock-short">KeyLog that does exactly nothing.</div></li><li><div class="item-name"><a class="struct" href="struct.OwnedTrustAnchor.html" title="struct rustls::OwnedTrustAnchor">OwnedTrustAnchor</a></div><div class="desc docblock-short">A trust anchor, commonly known as a “Root Certificate.”</div></li><li><div class="item-name"><a class="struct" href="struct.PrivateKey.html" title="struct rustls::PrivateKey">PrivateKey</a></div><div class="desc docblock-short">This type contains a private key by value.</div></li><li><div class="item-name"><a class="struct" href="struct.Reader.html" title="struct rustls::Reader">Reader</a></div><div class="desc docblock-short">A structure that implements <a href="https://doc.rust-lang.org/1.76.0/std/io/trait.Read.html" title="trait std::io::Read"><code>std::io::Read</code></a> for reading plaintext.</div></li><li><div class="item-name"><a class="struct" href="struct.RootCertStore.html" title="struct rustls::RootCertStore">RootCertStore</a></div><div class="desc docblock-short">A container for root certificates able to provide a root-of-trust
|
||
for connection authentication.</div></li><li><div class="item-name"><a class="struct" href="struct.Stream.html" title="struct rustls::Stream">Stream</a></div><div class="desc docblock-short">This type implements <code>io::Read</code> and <code>io::Write</code>, encapsulating
|
||
a Connection <code>C</code> and an underlying transport <code>T</code>, such as a socket.</div></li><li><div class="item-name"><a class="struct" href="struct.StreamOwned.html" title="struct rustls::StreamOwned">StreamOwned</a></div><div class="desc docblock-short">This type implements <code>io::Read</code> and <code>io::Write</code>, encapsulating
|
||
and owning a Connection <code>C</code> and an underlying blocking transport
|
||
<code>T</code>, such as a socket.</div></li><li><div class="item-name"><a class="struct" href="struct.SupportedKxGroup.html" title="struct rustls::SupportedKxGroup">SupportedKxGroup</a></div><div class="desc docblock-short">A key-exchange group supported by rustls.</div></li><li><div class="item-name"><a class="struct" href="struct.SupportedProtocolVersion.html" title="struct rustls::SupportedProtocolVersion">SupportedProtocolVersion</a></div><div class="desc docblock-short">A TLS protocol version supported by rustls.</div></li><li><div class="item-name"><a class="struct" href="struct.Ticketer.html" title="struct rustls::Ticketer">Ticketer</a></div><div class="desc docblock-short">A concrete, safe ticket creation mechanism.</div></li><li><div class="item-name"><a class="struct" href="struct.Tls12CipherSuite.html" title="struct rustls::Tls12CipherSuite">Tls12CipherSuite</a></div><div class="desc docblock-short">A TLS 1.2 cipher suite supported by rustls.</div></li><li><div class="item-name"><a class="struct" href="struct.Tls13CipherSuite.html" title="struct rustls::Tls13CipherSuite">Tls13CipherSuite</a></div><div class="desc docblock-short">A TLS 1.3 cipher suite supported by rustls.</div></li><li><div class="item-name"><a class="struct" href="struct.WantsCipherSuites.html" title="struct rustls::WantsCipherSuites">WantsCipherSuites</a></div><div class="desc docblock-short">Config builder state where the caller must supply cipher suites.</div></li><li><div class="item-name"><a class="struct" href="struct.WantsKxGroups.html" title="struct rustls::WantsKxGroups">WantsKxGroups</a></div><div class="desc docblock-short">Config builder state where the caller must supply key exchange groups.</div></li><li><div class="item-name"><a class="struct" href="struct.WantsVerifier.html" title="struct rustls::WantsVerifier">WantsVerifier</a></div><div class="desc docblock-short">Config builder state where the caller must supply a verifier.</div></li><li><div class="item-name"><a class="struct" href="struct.WantsVersions.html" title="struct rustls::WantsVersions">WantsVersions</a></div><div class="desc docblock-short">Config builder state where the caller must supply TLS protocol versions.</div></li><li><div class="item-name"><a class="struct" href="struct.Writer.html" title="struct rustls::Writer">Writer</a></div><div class="desc docblock-short">A structure that implements <a href="https://doc.rust-lang.org/1.76.0/std/io/trait.Write.html" title="trait std::io::Write"><code>std::io::Write</code></a> for writing plaintext.</div></li></ul><h2 id="enums" class="section-header"><a href="#enums">Enums</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.AlertDescription.html" title="enum rustls::AlertDescription">AlertDescription</a></div><div class="desc docblock-short">The <code>AlertDescription</code> TLS protocol enum. Values in this enum are taken
|
||
from the various RFCs covering TLS, and are listed by IANA.
|
||
The <code>Unknown</code> item is used when processing unrecognised ordinals.</div></li><li><div class="item-name"><a class="enum" href="enum.BulkAlgorithm.html" title="enum rustls::BulkAlgorithm">BulkAlgorithm</a></div><div class="desc docblock-short">Bulk symmetric encryption scheme used by a cipher suite.</div></li><li><div class="item-name"><a class="enum" href="enum.CertRevocationListError.html" title="enum rustls::CertRevocationListError">CertRevocationListError</a></div><div class="desc docblock-short">The ways in which a certificate revocation list (CRL) can be invalid.</div></li><li><div class="item-name"><a class="enum" href="enum.CertificateError.html" title="enum rustls::CertificateError">CertificateError</a></div><div class="desc docblock-short">The ways in which certificate validators can express errors.</div></li><li><div class="item-name"><a class="enum" href="enum.CipherSuite.html" title="enum rustls::CipherSuite">CipherSuite</a></div><div class="desc docblock-short">The <code>CipherSuite</code> TLS protocol enum. Values in this enum are taken
|
||
from the various RFCs covering TLS, and are listed by IANA.
|
||
The <code>Unknown</code> item is used when processing unrecognised ordinals.</div></li><li><div class="item-name"><a class="enum" href="enum.Connection.html" title="enum rustls::Connection">Connection</a></div><div class="desc docblock-short">A client or server connection.</div></li><li><div class="item-name"><a class="enum" href="enum.ContentType.html" title="enum rustls::ContentType">ContentType</a></div><div class="desc docblock-short">The <code>ContentType</code> TLS protocol enum. Values in this enum are taken
|
||
from the various RFCs covering TLS, and are listed by IANA.
|
||
The <code>Unknown</code> item is used when processing unrecognised ordinals.</div></li><li><div class="item-name"><a class="enum" href="enum.Error.html" title="enum rustls::Error">Error</a></div><div class="desc docblock-short">rustls reports protocol errors using this type.</div></li><li><div class="item-name"><a class="enum" href="enum.HandshakeType.html" title="enum rustls::HandshakeType">HandshakeType</a></div><div class="desc docblock-short">The <code>HandshakeType</code> TLS protocol enum. Values in this enum are taken
|
||
from the various RFCs covering TLS, and are listed by IANA.
|
||
The <code>Unknown</code> item is used when processing unrecognised ordinals.</div></li><li><div class="item-name"><a class="enum" href="enum.InvalidMessage.html" title="enum rustls::InvalidMessage">InvalidMessage</a></div><div class="desc docblock-short">A corrupt TLS message payload that resulted in an error.</div></li><li><div class="item-name"><a class="enum" href="enum.NamedGroup.html" title="enum rustls::NamedGroup">NamedGroup</a></div><div class="desc docblock-short">The <code>NamedGroup</code> TLS protocol enum. Values in this enum are taken
|
||
from the various RFCs covering TLS, and are listed by IANA.
|
||
The <code>Unknown</code> item is used when processing unrecognised ordinals.</div></li><li><div class="item-name"><a class="enum" href="enum.PeerIncompatible.html" title="enum rustls::PeerIncompatible">PeerIncompatible</a></div><div class="desc docblock-short">The set of cases where we failed to make a connection because a peer
|
||
doesn’t support a TLS version/feature we require.</div></li><li><div class="item-name"><a class="enum" href="enum.PeerMisbehaved.html" title="enum rustls::PeerMisbehaved">PeerMisbehaved</a></div><div class="desc docblock-short">The set of cases where we failed to make a connection because we thought
|
||
the peer was misbehaving.</div></li><li><div class="item-name"><a class="enum" href="enum.ProtocolVersion.html" title="enum rustls::ProtocolVersion">ProtocolVersion</a></div><div class="desc docblock-short">The <code>ProtocolVersion</code> TLS protocol enum. Values in this enum are taken
|
||
from the various RFCs covering TLS, and are listed by IANA.
|
||
The <code>Unknown</code> item is used when processing unrecognised ordinals.</div></li><li><div class="item-name"><a class="enum" href="enum.Side.html" title="enum rustls::Side">Side</a></div><div class="desc docblock-short">Side of the connection.</div></li><li><div class="item-name"><a class="enum" href="enum.SignatureAlgorithm.html" title="enum rustls::SignatureAlgorithm">SignatureAlgorithm</a></div><div class="desc docblock-short">The <code>SignatureAlgorithm</code> TLS protocol enum. Values in this enum are taken
|
||
from the various RFCs covering TLS, and are listed by IANA.
|
||
The <code>Unknown</code> item is used when processing unrecognised ordinals.</div></li><li><div class="item-name"><a class="enum" href="enum.SignatureScheme.html" title="enum rustls::SignatureScheme">SignatureScheme</a></div><div class="desc docblock-short">The <code>SignatureScheme</code> TLS protocol enum. Values in this enum are taken
|
||
from the various RFCs covering TLS, and are listed by IANA.
|
||
The <code>Unknown</code> item is used when processing unrecognised ordinals.</div></li><li><div class="item-name"><a class="enum" href="enum.SupportedCipherSuite.html" title="enum rustls::SupportedCipherSuite">SupportedCipherSuite</a></div><div class="desc docblock-short">A cipher suite supported by rustls.</div></li></ul><h2 id="statics" class="section-header"><a href="#statics">Statics</a></h2><ul class="item-table"><li><div class="item-name"><a class="static" href="static.ALL_CIPHER_SUITES.html" title="static rustls::ALL_CIPHER_SUITES">ALL_CIPHER_SUITES</a></div><div class="desc docblock-short">A list of all the cipher suites supported by rustls.</div></li><li><div class="item-name"><a class="static" href="static.ALL_KX_GROUPS.html" title="static rustls::ALL_KX_GROUPS">ALL_KX_GROUPS</a></div><div class="desc docblock-short">A list of all the key exchange groups supported by rustls.</div></li><li><div class="item-name"><a class="static" href="static.ALL_VERSIONS.html" title="static rustls::ALL_VERSIONS">ALL_VERSIONS</a></div><div class="desc docblock-short">A list of all the protocol versions supported by rustls.</div></li><li><div class="item-name"><a class="static" href="static.DEFAULT_CIPHER_SUITES.html" title="static rustls::DEFAULT_CIPHER_SUITES">DEFAULT_CIPHER_SUITES</a></div><div class="desc docblock-short">The cipher suite configuration that an application should use by default.</div></li><li><div class="item-name"><a class="static" href="static.DEFAULT_VERSIONS.html" title="static rustls::DEFAULT_VERSIONS">DEFAULT_VERSIONS</a></div><div class="desc docblock-short">The version configuration that an application should use by default.</div></li></ul><h2 id="traits" class="section-header"><a href="#traits">Traits</a></h2><ul class="item-table"><li><div class="item-name"><a class="trait" href="trait.ConfigSide.html" title="trait rustls::ConfigSide">ConfigSide</a></div><div class="desc docblock-short">Helper trait to abstract <a href="struct.ConfigBuilder.html" title="struct rustls::ConfigBuilder"><code>ConfigBuilder</code></a> over building a <a href="client/struct.ClientConfig.html" title="struct rustls::client::ClientConfig"><code>ClientConfig</code></a> or <a href="server/struct.ServerConfig.html" title="struct rustls::server::ServerConfig"><code>ServerConfig</code></a>.</div></li><li><div class="item-name"><a class="trait" href="trait.KeyLog.html" title="trait rustls::KeyLog">KeyLog</a></div><div class="desc docblock-short">This trait represents the ability to do something useful
|
||
with key material, such as logging it to a file for debugging.</div></li><li><div class="item-name"><a class="trait" href="trait.SideData.html" title="trait rustls::SideData">SideData</a></div><div class="desc docblock-short">Data specific to the peer’s side (client or server).</div></li></ul></section></div></main></body></html> |