pub struct TlsServerConfig { /* private fields */ }Expand description
TLS configuration for a server
Implementations§
Source§impl TlsServerConfig
impl TlsServerConfig
Sourcepub fn new(
client_subject_name: &str,
peer_cert_path: &Path,
local_cert_path: &Path,
private_key_path: &Path,
password: Option<&str>,
min_tls_version: MinTlsVersion,
certificate_mode: CertificateMode,
) -> Result<Self, TlsError>
👎Deprecated since 1.4.1: Please use full_pki or self_signed instead
pub fn new( client_subject_name: &str, peer_cert_path: &Path, local_cert_path: &Path, private_key_path: &Path, password: Option<&str>, min_tls_version: MinTlsVersion, certificate_mode: CertificateMode, ) -> Result<Self, TlsError>
full_pki or self_signed insteadLegacy method of creating a TLS server configuration
Sourcepub fn full_pki(
client_subject_name: Option<String>,
peer_cert_path: &Path,
local_cert_path: &Path,
private_key_path: &Path,
password: Option<&str>,
min_tls_version: MinTlsVersion,
) -> Result<Self, TlsError>
pub fn full_pki( client_subject_name: Option<String>, peer_cert_path: &Path, local_cert_path: &Path, private_key_path: &Path, password: Option<&str>, min_tls_version: MinTlsVersion, ) -> Result<Self, TlsError>
Create a TLS server configuration that expects a full PKI with an authority, and possibly intermediate CA certificates.
If client_subject_name is specified, than the server will verify name is present in the
SAN extension or in the Common Name of the client certificate.
If client_subject_name is set to None, then no client name validate is performed, and
any authenticated client is allowed.
Sourcepub fn self_signed(
peer_cert_path: &Path,
local_cert_path: &Path,
private_key_path: &Path,
password: Option<&str>,
min_tls_version: MinTlsVersion,
) -> Result<Self, TlsError>
pub fn self_signed( peer_cert_path: &Path, local_cert_path: &Path, private_key_path: &Path, password: Option<&str>, min_tls_version: MinTlsVersion, ) -> Result<Self, TlsError>
Create a TLS server configuration that expects the client to present a single certificate.
In lieu of performing client subject name validation, the server validates:
- That the client presents a single certificate
- That the certificate is a byte-for-byte match with the one loaded in
peer_cert_path. - That the certificate’s Validity (not before / not after) is currently valid.
Auto Trait Implementations§
impl Freeze for TlsServerConfig
impl !RefUnwindSafe for TlsServerConfig
impl Send for TlsServerConfig
impl Sync for TlsServerConfig
impl Unpin 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