pub struct TlsServerConfig {
pub config: Config,
pub insecure: bool,
pub client_ca_file: Option<String>,
pub client_ca_pem: Option<String>,
pub reload_client_ca_file: bool,
}Fields§
§config: ConfigThe Config struct
insecure: boolinsecure do not setup a TLS server
client_ca_file: Option<String>Path to the TLS cert to use by the server to verify a client certificate. (optional)
client_ca_pem: Option<String>PEM encoded CA cert to use by the server to verify a client certificate. (optional)
reload_client_ca_file: boolReload the ClientCAs file when it is modified TODO(msardara): not implemented yet
Implementations§
Source§impl TlsServerConfig
impl TlsServerConfig
Sourcepub fn with_insecure(self, insecure: bool) -> Self
pub fn with_insecure(self, insecure: bool) -> Self
Set insecure (disable TLS)
Sourcepub fn with_client_ca_file(self, client_ca_file: &str) -> Self
pub fn with_client_ca_file(self, client_ca_file: &str) -> Self
Set CA file for client auth
Sourcepub fn with_client_ca_pem(self, client_ca_pem: &str) -> Self
pub fn with_client_ca_pem(self, client_ca_pem: &str) -> Self
Set CA pem for client auth
Sourcepub fn with_reload_client_ca_file(self, reload_client_ca_file: bool) -> Self
pub fn with_reload_client_ca_file(self, reload_client_ca_file: bool) -> Self
Set reload_client_ca_file
Sourcepub fn with_ca_file(self, ca_file: &str) -> Self
pub fn with_ca_file(self, ca_file: &str) -> Self
Set CA file
Sourcepub fn with_ca_pem(self, ca_pem: &str) -> Self
pub fn with_ca_pem(self, ca_pem: &str) -> Self
Set CA pem
Sourcepub fn with_include_system_ca_certs_pool(
self,
include_system_ca_certs_pool: bool,
) -> Self
pub fn with_include_system_ca_certs_pool( self, include_system_ca_certs_pool: bool, ) -> Self
Set include system CA certs pool
Sourcepub fn with_cert_file(self, cert_file: &str) -> Self
pub fn with_cert_file(self, cert_file: &str) -> Self
Set cert file
Sourcepub fn with_cert_pem(self, cert_pem: &str) -> Self
pub fn with_cert_pem(self, cert_pem: &str) -> Self
Set cert pem
Sourcepub fn with_key_file(self, key_file: &str) -> Self
pub fn with_key_file(self, key_file: &str) -> Self
Set key file
Sourcepub fn with_key_pem(self, key_pem: &str) -> Self
pub fn with_key_pem(self, key_pem: &str) -> Self
Set key pem
Sourcepub fn with_tls_version(self, tls_version: &str) -> Self
pub fn with_tls_version(self, tls_version: &str) -> Self
Set TLS version
Sourcepub fn with_reload_interval(self, reload_interval: Option<Duration>) -> Self
pub fn with_reload_interval(self, reload_interval: Option<Duration>) -> Self
Set reload interval
pub fn load_rustls_server_config( &self, ) -> Result<Option<RustlsServerConfig>, ConfigError>
Trait Implementations§
Source§impl Clone for TlsServerConfig
impl Clone for TlsServerConfig
Source§fn clone(&self) -> TlsServerConfig
fn clone(&self) -> TlsServerConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Configuration for TlsServerConfig
impl Configuration for TlsServerConfig
Source§impl Debug for TlsServerConfig
impl Debug for TlsServerConfig
Source§impl Default for TlsServerConfig
impl Default for TlsServerConfig
Source§impl<'de> Deserialize<'de> for TlsServerConfig
impl<'de> Deserialize<'de> for TlsServerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TlsServerConfig
Display the ServerConfig
impl Display for TlsServerConfig
Display the ServerConfig
Source§impl PartialEq for TlsServerConfig
impl PartialEq for TlsServerConfig
Source§fn eq(&self, other: &TlsServerConfig) -> bool
fn eq(&self, other: &TlsServerConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl RustlsConfigLoader<ServerConfig> for TlsServerConfig
impl RustlsConfigLoader<ServerConfig> for TlsServerConfig
fn load_rustls_config(&self) -> Result<Option<RustlsServerConfig>, ConfigError>
impl StructuralPartialEq for TlsServerConfig
Auto Trait Implementations§
impl Freeze for TlsServerConfig
impl RefUnwindSafe for TlsServerConfig
impl Send for TlsServerConfig
impl Sync for TlsServerConfig
impl Unpin for TlsServerConfig
impl UnsafeUnpin for TlsServerConfig
impl UnwindSafe for TlsServerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request