pub struct TlsBuilderConfig { /* private fields */ }
Implementations§
Source§impl TlsBuilderConfig
impl TlsBuilderConfig
Sourcepub fn https_only(self) -> Self
pub fn https_only(self) -> Self
Enforce the use of HTTPS when connecting
Only URLs using the HTTPS scheme will be connectable.
Default is https_or_http
.
Sourcepub fn https_or_http(self) -> Self
pub fn https_or_http(self) -> Self
Allow both HTTPS and HTTP when connecting
HTTPS URLs will be handled through rustls, HTTP URLs will be handled directly.
Default is https_or_http
.
Sourcepub fn enable_http1(self) -> Self
pub fn enable_http1(self) -> Self
Enable HTTP1
This needs to be called explicitly, no protocol is enabled by default
Sourcepub fn enable_http2(self) -> Self
pub fn enable_http2(self) -> Self
Enable HTTP2
This needs to be called explicitly, no protocol is enabled by default
Sourcepub fn enable_all_versions(self) -> Self
pub fn enable_all_versions(self) -> Self
Enable all HTTP versions
For now, this enables both HTTP 1 and 2. In the future, other supported versions will be enabled as well.
Sourcepub fn with_server_name(self, override_server_name: String) -> Self
pub fn with_server_name(self, override_server_name: String) -> Self
Override server name for the TLS stack
By default, for each connection the library will extract host portion of the destination URL and verify that server certificate contains this value.
If this method is called, the library will instead verify that server
certificate contains override_server_name
. Domain name included in
the URL will not affect certificate validation.