Struct TlsClientConfig
pub struct TlsClientConfig(/* private fields */);net only.Expand description
A backend agnostic builder for the common TLS configs.
It holds a set of fine grained config extensions (e.g. TlsAlpn, TlsServerVerify)
and exposes typed setters for the settings both TLS backends support.
Backend crates add setters for their backend-specific pieces via extension
traits (RustlsClientConfigExt).
Implementations§
§impl TlsClientConfig
impl TlsClientConfig
pub fn new() -> TlsClientConfig
Available on crate feature boring only.
pub fn new() -> TlsClientConfig
boring only.Create an empty config.
pub fn default_http() -> TlsClientConfig
Available on crate feature boring only.
pub fn default_http() -> TlsClientConfig
boring only.Create a default TlsClientConfig that enables:
- ALPN: H2, http1.1
- Keylogger:
KeyLogIntent::Environment
pub fn write_to(&self, extensions: &Extensions)
Available on crate feature boring only.
pub fn write_to(&self, extensions: &Extensions)
boring only.Transfer this config’s pieces onto extensions (appending, so they
override existing entries of the same type — newest-wins). Use this to
transfer the tls config to e.g. request extensions
pub fn with_alpn(self, protocols: Vec<ApplicationProtocol>) -> TlsClientConfig
Available on crate feature boring only.
pub fn with_alpn(self, protocols: Vec<ApplicationProtocol>) -> TlsClientConfig
boring only.Set the ALPN protocols to offer.
pub fn set_alpn(
&mut self,
protocols: Vec<ApplicationProtocol>,
) -> &mut TlsClientConfig
Available on crate feature boring only.
pub fn set_alpn( &mut self, protocols: Vec<ApplicationProtocol>, ) -> &mut TlsClientConfig
boring only.Set the ALPN protocols to offer.
pub fn with_alpn_http_auto(self) -> TlsClientConfig
Available on crate feature boring only.
pub fn with_alpn_http_auto(self) -> TlsClientConfig
boring only.Offer HTTP/2 and HTTP/1.1 via ALPN.
pub fn set_alpn_http_auto(&mut self) -> &mut TlsClientConfig
Available on crate feature boring only.
pub fn set_alpn_http_auto(&mut self) -> &mut TlsClientConfig
boring only.Offer HTTP/2 and HTTP/1.1 via ALPN.
pub fn with_alpn_http_1(self) -> TlsClientConfig
Available on crate feature boring only.
pub fn with_alpn_http_1(self) -> TlsClientConfig
boring only.Offer HTTP/1.1 only via ALPN.
pub fn set_alpn_http_1(&mut self) -> &mut TlsClientConfig
Available on crate feature boring only.
pub fn set_alpn_http_1(&mut self) -> &mut TlsClientConfig
boring only.Offer HTTP/1.1 only via ALPN.
pub fn with_alpn_http_2(self) -> TlsClientConfig
Available on crate feature boring only.
pub fn with_alpn_http_2(self) -> TlsClientConfig
boring only.Offer HTTP/2 only via ALPN.
pub fn set_alpn_http_2(&mut self) -> &mut TlsClientConfig
Available on crate feature boring only.
pub fn set_alpn_http_2(&mut self) -> &mut TlsClientConfig
boring only.Offer HTTP/2 only via ALPN.
pub fn with_server_name(self, server_name: Host) -> TlsClientConfig
Available on crate feature boring only.
pub fn with_server_name(self, server_name: Host) -> TlsClientConfig
boring only.Set the client SNI (server name) to send.
Overrides the SNI the connector would otherwise derive: the transport
authority host, or for a tunnel connector, the TlsTunnel sni
pub fn set_server_name(&mut self, server_name: Host) -> &mut TlsClientConfig
Available on crate feature boring only.
pub fn set_server_name(&mut self, server_name: Host) -> &mut TlsClientConfig
boring only.Set the client SNI (server name) to send.
Overrides the SNI the connector would otherwise derive: the transport
authority host, or for a tunnel connector, the TlsTunnel sni
pub fn with_server_verify(self, mode: ServerVerifyMode) -> TlsClientConfig
Available on crate feature boring only.
pub fn with_server_verify(self, mode: ServerVerifyMode) -> TlsClientConfig
boring only.Set how the server certificate is verified.
pub fn set_server_verify(
&mut self,
mode: ServerVerifyMode,
) -> &mut TlsClientConfig
Available on crate feature boring only.
pub fn set_server_verify( &mut self, mode: ServerVerifyMode, ) -> &mut TlsClientConfig
boring only.Set how the server certificate is verified.
pub fn with_supported_versions(
self,
versions: Vec<ProtocolVersion>,
) -> TlsClientConfig
Available on crate feature boring only.
pub fn with_supported_versions( self, versions: Vec<ProtocolVersion>, ) -> TlsClientConfig
boring only.Set the supported protocol versions.
pub fn set_supported_versions(
&mut self,
versions: Vec<ProtocolVersion>,
) -> &mut TlsClientConfig
Available on crate feature boring only.
pub fn set_supported_versions( &mut self, versions: Vec<ProtocolVersion>, ) -> &mut TlsClientConfig
boring only.Set the supported protocol versions.
pub fn with_keylog(self, intent: KeyLogIntent) -> TlsClientConfig
Available on crate feature boring only.
pub fn with_keylog(self, intent: KeyLogIntent) -> TlsClientConfig
boring only.Set the keylog intent.
pub fn set_keylog(&mut self, intent: KeyLogIntent) -> &mut TlsClientConfig
Available on crate feature boring only.
pub fn set_keylog(&mut self, intent: KeyLogIntent) -> &mut TlsClientConfig
boring only.Set the keylog intent.
pub fn with_client_auth(self, client_auth: ClientAuth) -> TlsClientConfig
Available on crate feature boring only.
pub fn with_client_auth(self, client_auth: ClientAuth) -> TlsClientConfig
boring only.Set the client certificate authentication material (mTLS).
pub fn set_client_auth(
&mut self,
client_auth: ClientAuth,
) -> &mut TlsClientConfig
Available on crate feature boring only.
pub fn set_client_auth( &mut self, client_auth: ClientAuth, ) -> &mut TlsClientConfig
boring only.Set the client certificate authentication material (mTLS).
pub fn with_store_server_cert_chain(self, store: bool) -> TlsClientConfig
Available on crate feature boring only.
pub fn with_store_server_cert_chain(self, store: bool) -> TlsClientConfig
boring only.Set whether the peer certificate chain is captured.
pub fn set_store_server_cert_chain(
&mut self,
store: bool,
) -> &mut TlsClientConfig
Available on crate feature boring only.
pub fn set_store_server_cert_chain( &mut self, store: bool, ) -> &mut TlsClientConfig
boring only.Set whether the peer certificate chain is captured.
pub fn as_extensions(&self) -> &Extensions
boring only.Trait Implementations§
§impl Clone for TlsClientConfig
impl Clone for TlsClientConfig
§fn clone(&self) -> TlsClientConfig
fn clone(&self) -> TlsClientConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for TlsClientConfig
impl Debug for TlsClientConfig
§impl Default for TlsClientConfig
impl Default for TlsClientConfig
§fn default() -> TlsClientConfig
fn default() -> TlsClientConfig
§impl RustlsClientConfigExt for TlsClientConfig
impl RustlsClientConfigExt for TlsClientConfig
§fn with_cert_verifier(
self,
verifier: Arc<dyn ServerCertVerifier>,
) -> TlsClientConfig
fn with_cert_verifier( self, verifier: Arc<dyn ServerCertVerifier>, ) -> TlsClientConfig
§fn set_cert_verifier(
&mut self,
verifier: Arc<dyn ServerCertVerifier>,
) -> &mut TlsClientConfig
fn set_cert_verifier( &mut self, verifier: Arc<dyn ServerCertVerifier>, ) -> &mut TlsClientConfig
§fn with_modify_rustls_config(
self,
modify: impl Fn(ClientConfig) -> Result<ClientConfig, Box<dyn Error + Sync + Send>> + Send + Sync + 'static,
) -> TlsClientConfig
fn with_modify_rustls_config( self, modify: impl Fn(ClientConfig) -> Result<ClientConfig, Box<dyn Error + Sync + Send>> + Send + Sync + 'static, ) -> TlsClientConfig
ClientConfig build: see ModifyRustlsClientConfig.§fn set_modify_rustls_config(
&mut self,
modify: impl Fn(ClientConfig) -> Result<ClientConfig, Box<dyn Error + Sync + Send>> + Send + Sync + 'static,
) -> &mut TlsClientConfig
fn set_modify_rustls_config( &mut self, modify: impl Fn(ClientConfig) -> Result<ClientConfig, Box<dyn Error + Sync + Send>> + Send + Sync + 'static, ) -> &mut TlsClientConfig
ClientConfig build: see ModifyRustlsClientConfig.Auto Trait Implementations§
impl Freeze for TlsClientConfig
impl RefUnwindSafe for TlsClientConfig
impl Send for TlsClientConfig
impl Sync for TlsClientConfig
impl Unpin for TlsClientConfig
impl UnsafeUnpin for TlsClientConfig
impl UnwindSafe for TlsClientConfig
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§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§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
value to writer§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
value to writer§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
value to writer§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
value to writer§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
value to writer