Struct static_web_server::tls::TlsConfigBuilder
source · pub struct TlsConfigBuilder { /* private fields */ }
http2
only.Expand description
Builder to set the configuration for the Tls server.
Implementations§
source§impl TlsConfigBuilder
impl TlsConfigBuilder
sourcepub fn new() -> TlsConfigBuilder
pub fn new() -> TlsConfigBuilder
Create a new TlsConfigBuilder
sourcepub fn key_path(self, path: impl AsRef<Path>) -> Self
pub fn key_path(self, path: impl AsRef<Path>) -> Self
sets the Tls key via File Path, returns TlsConfigError::IoError
if the file cannot be open
sourcepub fn cert_path(self, path: impl AsRef<Path>) -> Self
pub fn cert_path(self, path: impl AsRef<Path>) -> Self
Specify the file path for the TLS certificate to use.
sourcepub fn client_auth_optional_path(self, path: impl AsRef<Path>) -> Self
pub fn client_auth_optional_path(self, path: impl AsRef<Path>) -> Self
Sets the trust anchor for optional Tls client authentication via file path.
Anonymous and authenticated clients will be accepted. If no trust anchor is provided by any
of the client_auth_
methods, then client authentication is disabled by default.
sourcepub fn client_auth_optional(self, trust_anchor: &[u8]) -> Self
pub fn client_auth_optional(self, trust_anchor: &[u8]) -> Self
Sets the trust anchor for optional Tls client authentication via bytes slice.
Anonymous and authenticated clients will be accepted. If no trust anchor is provided by any
of the client_auth_
methods, then client authentication is disabled by default.
sourcepub fn client_auth_required_path(self, path: impl AsRef<Path>) -> Self
pub fn client_auth_required_path(self, path: impl AsRef<Path>) -> Self
Sets the trust anchor for required Tls client authentication via file path.
Only authenticated clients will be accepted. If no trust anchor is provided by any of the
client_auth_
methods, then client authentication is disabled by default.
sourcepub fn client_auth_required(self, trust_anchor: &[u8]) -> Self
pub fn client_auth_required(self, trust_anchor: &[u8]) -> Self
Sets the trust anchor for required Tls client authentication via bytes slice.
Only authenticated clients will be accepted. If no trust anchor is provided by any of the
client_auth_
methods, then client authentication is disabled by default.
sourcepub fn build(self) -> Result<ServerConfig, TlsConfigError>
pub fn build(self) -> Result<ServerConfig, TlsConfigError>
Builds TLS configuration.