pub struct TlsConfig { /* private fields */ }Expand description
Configuration of TLS.
This configuration is in common for both the different TLS mechanisms (available through feature flags rustls and native-tls).
Implementations§
Source§impl TlsConfig
impl TlsConfig
Sourcepub fn provider(&self) -> TlsProvider
pub fn provider(&self) -> TlsProvider
The provider to use.
Defaults to TlsProvider::Rustls.
Sourcepub fn client_cert(&self) -> Option<&ClientCert>
pub fn client_cert(&self) -> Option<&ClientCert>
Client certificate chain with corresponding private key.
Defaults to None.
Sourcepub fn root_certs(&self) -> &RootCerts
pub fn root_certs(&self) -> &RootCerts
The set of trusted root certificates to use to validate server certificates.
Defaults to WebPki.
Sourcepub fn use_sni(&self) -> bool
pub fn use_sni(&self) -> bool
Whether to send SNI (Server Name Indication) to the remote server.
This is used by the server to determine which domain/certificate we are connecting to for servers where multiple domains/sites are hosted on the same IP.
Defaults to true.
Sourcepub fn disable_verification(&self) -> bool
pub fn disable_verification(&self) -> bool
WARNING Disable all server certificate verification.
This breaks encryption and leaks secrets. Must never be enabled for code where any level of security is required.
Sourcepub fn unversioned_rustls_crypto_provider(&self) -> &Option<Arc<CryptoProvider>>
pub fn unversioned_rustls_crypto_provider(&self) -> &Option<Arc<CryptoProvider>>
Specific CryptoProvider to use for rustls.
§UNSTABLE API
NOTE: This API is not guaranteed for semver.
rustls is not (yet) semver 1.x and ureq can’t promise that this API is upheld.
If rustls makes a breaking change regarding CryptoProvider their configuration,
or incompatible data types between rustls versions, ureq will NOT bump a major version.
ureq will update to the latest rustls minor version using ureq minor versions.