Struct TlsAcceptorDataBuilder
pub struct TlsAcceptorDataBuilder { /* private fields */ }Expand description
TlsAcceptorDataBuilder can be used to construct rustls::ServerConfig for most common use cases in Rama.
If this doesn’t work for your use case, no problem [TlsConnectorData] can be created from a raw rustls::ServerConfig
Implementations§
§impl TlsAcceptorDataBuilder
impl TlsAcceptorDataBuilder
pub fn new(
cert_chain: Vec<CertificateDer<'static>>,
key_der: PrivateKeyDer<'static>,
) -> Result<TlsAcceptorDataBuilder, OpaqueError>
pub fn new( cert_chain: Vec<CertificateDer<'static>>, key_der: PrivateKeyDer<'static>, ) -> Result<TlsAcceptorDataBuilder, OpaqueError>
Create a TlsAcceptorDataBuilder support all tls versions, using no client auth, and the
provided certificate chain and private key for the server
pub fn new_self_signed(
data: SelfSignedData,
) -> Result<TlsAcceptorDataBuilder, OpaqueError>
pub fn new_self_signed( data: SelfSignedData, ) -> Result<TlsAcceptorDataBuilder, OpaqueError>
Create a TlsAcceptorDataBuilder support all tls versions, using no client auth, and a self
generated certificate chain and private key
pub fn set_env_key_logger(
&mut self,
) -> Result<&mut TlsAcceptorDataBuilder, OpaqueError>
pub fn set_env_key_logger( &mut self, ) -> Result<&mut TlsAcceptorDataBuilder, OpaqueError>
If KeyLogIntent::Environment is set to a path, create a key logger that will write to that path
and set it in the current config
pub fn with_env_key_logger(self) -> Result<TlsAcceptorDataBuilder, OpaqueError>
pub fn with_env_key_logger(self) -> Result<TlsAcceptorDataBuilder, OpaqueError>
Same as Self::set_env_key_logger but consuming self
pub fn set_alpn_protocols(
&mut self,
protos: &[ApplicationProtocol],
) -> &mut TlsAcceptorDataBuilder
pub fn set_alpn_protocols( &mut self, protos: &[ApplicationProtocol], ) -> &mut TlsAcceptorDataBuilder
Set ApplicationProtocols supported in alpn extension
pub fn with_alpn_protocols(
self,
protos: &[ApplicationProtocol],
) -> TlsAcceptorDataBuilder
pub fn with_alpn_protocols( self, protos: &[ApplicationProtocol], ) -> TlsAcceptorDataBuilder
Same as Self::set_alpn_protocols but consuming self
pub fn set_alpn_protocols_http_auto(&mut self) -> &mut TlsAcceptorDataBuilder
pub fn set_alpn_protocols_http_auto(&mut self) -> &mut TlsAcceptorDataBuilder
Set alpn protocols to most commonly used http protocols: ApplicationProtocol::HTTP_2, ApplicationProtocol::HTTP_11
pub fn with_alpn_protocols_http_auto(self) -> TlsAcceptorDataBuilder
pub fn with_alpn_protocols_http_auto(self) -> TlsAcceptorDataBuilder
Same as Self::set_alpn_protocols_http_auto but consuming self
pub fn build(self) -> TlsAcceptorData
pub fn build(self) -> TlsAcceptorData
Build TlsAcceptorData from the current config
pub fn into_rustls_config(self) -> ServerConfig
pub fn into_rustls_config(self) -> ServerConfig
Convert current config into a rustls config.
Useful if you want to use some utilities this builder provides and then continue on directly with a native rustls config
Trait Implementations§
§impl From<ServerConfig> for TlsAcceptorDataBuilder
impl From<ServerConfig> for TlsAcceptorDataBuilder
§fn from(value: ServerConfig) -> TlsAcceptorDataBuilder
fn from(value: ServerConfig) -> TlsAcceptorDataBuilder
Auto Trait Implementations§
impl Freeze for TlsAcceptorDataBuilder
impl !RefUnwindSafe for TlsAcceptorDataBuilder
impl Send for TlsAcceptorDataBuilder
impl Sync for TlsAcceptorDataBuilder
impl Unpin for TlsAcceptorDataBuilder
impl !UnwindSafe for TlsAcceptorDataBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more