pub struct TlsContainer { /* private fields */ }
Available on crate feature
tls
only.Expand description
TLS container based on Rustls.
Implementations§
Source§impl TlsContainer
impl TlsContainer
Sourcepub fn add_resolver_from_acme(
&mut self,
acme: ACME,
) -> Result<(), TlsContainerError>
Available on crate feature acme
only.
pub fn add_resolver_from_acme( &mut self, acme: ACME, ) -> Result<(), TlsContainerError>
acme
only.Add ResolvesServerCertAcme for all hosts.
Source§impl TlsContainer
impl TlsContainer
Sourcepub fn axum_acceptor(&self) -> Result<RustlsAcceptor, TlsContainerError>
Available on crate feature axum
only.
pub fn axum_acceptor(&self) -> Result<RustlsAcceptor, TlsContainerError>
axum
only.Creates an axum RustlsAcceptor.
Sourcepub fn axum_acme_acceptor(
&self,
acme: ACME,
) -> Result<AxumAcceptor, TlsContainerError>
Available on crate features axum
and acme
only.
pub fn axum_acme_acceptor( &self, acme: ACME, ) -> Result<AxumAcceptor, TlsContainerError>
axum
and acme
only.Creates an AxumAcceptor.
Sourcepub fn axum_config(&self) -> Result<RustlsConfig, TlsContainerError>
Available on crate feature axum
only.
pub fn axum_config(&self) -> Result<RustlsConfig, TlsContainerError>
axum
only.Creates an axum RustlsConfig.
Source§impl TlsContainer
impl TlsContainer
Sourcepub fn add_key(
&mut self,
sni: ByteString,
certified_key: Arc<CertifiedKey>,
) -> Result<(), TlsContainerError>
pub fn add_key( &mut self, sni: ByteString, certified_key: Arc<CertifiedKey>, ) -> Result<(), TlsContainerError>
Add key.
Sourcepub fn add_delegate(
&mut self,
sni: ByteString,
resolver: Arc<dyn ResolvesServerCert>,
) -> Result<(), TlsContainerError>
pub fn add_delegate( &mut self, sni: ByteString, resolver: Arc<dyn ResolvesServerCert>, ) -> Result<(), TlsContainerError>
Add delegate.
Sourcepub fn add_key_from_pem(
&mut self,
sni: ByteString,
certificates_pem: &[u8],
private_key_pem: &[u8],
) -> Result<(), TlsContainerError>
pub fn add_key_from_pem( &mut self, sni: ByteString, certificates_pem: &[u8], private_key_pem: &[u8], ) -> Result<(), TlsContainerError>
Add key from PEM (Privacy-Enhanced Mail) files.
Sourcepub fn http_server_config(&self) -> Result<ServerConfig, TlsContainerError>
pub fn http_server_config(&self) -> Result<ServerConfig, TlsContainerError>
Creates a ServerConfig for HTTP, specifically for the “h2” and “http/1.1” ALPN (Application-Layer Protocol Negotiation) protocols.
Will return an error if we have no keys.
Otherwise, if we have more than one key then the configuration will use the SNI sent by the client in its TLS hello message to select the appropriate key in the store.
Sourcepub fn resolver(&self) -> Result<SniResolver, TlsContainerError>
pub fn resolver(&self) -> Result<SniResolver, TlsContainerError>
Creates a SniResolver.
Trait Implementations§
Source§impl Clone for TlsContainer
impl Clone for TlsContainer
Source§fn clone(&self) -> TlsContainer
fn clone(&self) -> TlsContainer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TlsContainer
impl Debug for TlsContainer
Source§impl Default for TlsContainer
impl Default for TlsContainer
Source§fn default() -> TlsContainer
fn default() -> TlsContainer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TlsContainer
impl !RefUnwindSafe for TlsContainer
impl Send for TlsContainer
impl Sync for TlsContainer
impl Unpin for TlsContainer
impl !UnwindSafe for TlsContainer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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