target_os=unknown or bare-metal)) and crate feature __tls only.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 rustls, the feature set is designed to only
enable configuration that is shared among available backends. This allows
reqwest to change the default to native-tls (or another) by configuration.
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 tls_backend_rustls()).
§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
This backend uses the rustls crate, a TLS library written in Rust.
Structs§
- Certificate
- Represents a server X509 certificate.
- Certificate
Revocation List __rustls - Represents a X509 certificate revocation list.
- Identity
- Represents a private key and X509 cert as a client certificate.
- TlsInfo
- Hyper extension carrying extra TLS layer information.
Made available to clients on responses when
tls_infois set. - Version
- A TLS protocol version.
Functions§
- default_
root_ store __rustls - Returns a cached default root certificate store with webpki roots and native OS root CAs.
- default_
root_ store_ arc __rustls - Returns a cached
Arc<RootCertStore>, avoiding deep clones on every call. - merged_
root_ store __rustls - Creates a root certificate store from the cached default store plus user-provided certs.