Expand description
TLS configuration and types
A Client
will use transport layer security (TLS) by default to connect to
HTTPS destinations.
§Backends
reqwest supports several TLS backends, enabled with Cargo features.
§default-tls
reqwest will pick a TLS backend by default. This is true when the
default-tls
feature is enabled.
While it currently uses native-tls
, the feature set is designed to only
enable configuration that is shared among available backends. This allows
reqwest to change the default to rustls
(or another) at some point in the
future.
Since Cargo features are additive, other crates in your dependency tree can
cause the default backend to be enabled. If you wish to ensure your
Client
uses a specific backend, call the appropriate builder methods
(such as use_rustls_tls()
).
§native-tls
This backend uses the native-tls crate. That will try to use the system TLS on Windows and Mac, and OpenSSL on Linux targets.
Enabling the feature explicitly allows for native-tls
-specific
configuration options.
§rustls-tls
This backend uses the rustls crate, a TLS library written in Rust.
Structs§
- Represents a server X509 certificate.
- Represents a X509 certificate revocation list.
- Represents a private key and X509 cert as a client certificate.
- Hyper extension carrying extra TLS layer information. Made available to clients on responses when
tls_info
is set. - A TLS protocol version.