Struct TlsMitmEgressServerAuth
pub struct TlsMitmEgressServerAuth { /* private fields */ }boring only.Expand description
Server-authentication policy for upstream TLS connections made by a
TlsMitmRelay.
This deliberately exposes only certificate/identity verification controls. TLS fingerprint and protocol-negotiation settings remain owned by the relay and mirrored from the ingress ClientHello.
Verification is disabled by default. A transparent MITM relay should not
reject an upstream certificate that the intercepted client may deliberately
accept; doing so would make previously viable traffic fail at the relay.
Configure ServerVerifyMode::Auto explicitly when the proxy operator
wants to enforce upstream certificate and hostname verification.
Implementations§
§impl TlsMitmEgressServerAuth
impl TlsMitmEgressServerAuth
pub fn new() -> TlsMitmEgressServerAuth
pub fn new() -> TlsMitmEgressServerAuth
Create a policy with upstream certificate verification disabled.
pub fn with_server_name(self, server_name: Host) -> TlsMitmEgressServerAuth
pub fn with_server_name(self, server_name: Host) -> TlsMitmEgressServerAuth
Set the upstream identity used for certificate verification.
A DNS identity is also sent as SNI. Without an explicit identity, the relay uses ingress SNI. When verification or pinning is configured and ingress SNI is absent, it falls back to the connector-target host.
pub fn set_server_name(
&mut self,
server_name: Host,
) -> &mut TlsMitmEgressServerAuth
pub fn set_server_name( &mut self, server_name: Host, ) -> &mut TlsMitmEgressServerAuth
Set the upstream identity used for certificate verification.
A DNS identity is also sent as SNI. Without an explicit identity, the relay uses ingress SNI. When verification or pinning is configured and ingress SNI is absent, it falls back to the connector-target host.
pub fn with_server_verify(
self,
mode: ServerVerifyMode,
) -> TlsMitmEgressServerAuth
pub fn with_server_verify( self, mode: ServerVerifyMode, ) -> TlsMitmEgressServerAuth
Set how the upstream certificate is verified.
Select ServerVerifyMode::Auto to opt into normal certificate and
hostname verification.
pub fn set_server_verify(
&mut self,
mode: ServerVerifyMode,
) -> &mut TlsMitmEgressServerAuth
pub fn set_server_verify( &mut self, mode: ServerVerifyMode, ) -> &mut TlsMitmEgressServerAuth
Set how the upstream certificate is verified.
Select ServerVerifyMode::Auto to opt into normal certificate and
hostname verification.
pub fn with_server_cert_pins(
self,
pins: TlsServerCertPins,
) -> TlsMitmEgressServerAuth
pub fn with_server_cert_pins( self, pins: TlsServerCertPins, ) -> TlsMitmEgressServerAuth
Require the upstream leaf certificate to match an applicable pin set.
pub fn set_server_cert_pins(
&mut self,
pins: TlsServerCertPins,
) -> &mut TlsMitmEgressServerAuth
pub fn set_server_cert_pins( &mut self, pins: TlsServerCertPins, ) -> &mut TlsMitmEgressServerAuth
Require the upstream leaf certificate to match an applicable pin set.
pub fn with_server_trust(self, trust: TlsServerTrust) -> TlsMitmEgressServerAuth
pub fn with_server_trust(self, trust: TlsServerTrust) -> TlsMitmEgressServerAuth
Replace the complete upstream trust policy.
Trust settings are used only with ServerVerifyMode::Auto.
pub fn set_server_trust(
&mut self,
trust: TlsServerTrust,
) -> &mut TlsMitmEgressServerAuth
pub fn set_server_trust( &mut self, trust: TlsServerTrust, ) -> &mut TlsMitmEgressServerAuth
Replace the complete upstream trust policy.
Trust settings are used only with ServerVerifyMode::Auto.
pub fn try_with_server_trust_anchors(
self,
certificates: impl IntoIterator<Item = CertificateDer<'static>>,
) -> Result<TlsMitmEgressServerAuth, Box<dyn Error + Sync + Send>>
pub fn try_with_server_trust_anchors( self, certificates: impl IntoIterator<Item = CertificateDer<'static>>, ) -> Result<TlsMitmEgressServerAuth, Box<dyn Error + Sync + Send>>
Replace the default roots with the supplied upstream trust anchors.
Trust settings are used only with ServerVerifyMode::Auto.
pub fn try_set_server_trust_anchors(
&mut self,
certificates: impl IntoIterator<Item = CertificateDer<'static>>,
) -> Result<&mut TlsMitmEgressServerAuth, Box<dyn Error + Sync + Send>>
pub fn try_set_server_trust_anchors( &mut self, certificates: impl IntoIterator<Item = CertificateDer<'static>>, ) -> Result<&mut TlsMitmEgressServerAuth, Box<dyn Error + Sync + Send>>
Replace the default roots with the supplied upstream trust anchors.
Trust settings are used only with ServerVerifyMode::Auto.
pub fn try_with_extra_server_trust_anchors(
self,
certificates: impl IntoIterator<Item = CertificateDer<'static>>,
) -> Result<TlsMitmEgressServerAuth, Box<dyn Error + Sync + Send>>
pub fn try_with_extra_server_trust_anchors( self, certificates: impl IntoIterator<Item = CertificateDer<'static>>, ) -> Result<TlsMitmEgressServerAuth, Box<dyn Error + Sync + Send>>
Add certificates to the configured upstream trust roots.
Trust settings are used only with ServerVerifyMode::Auto.
pub fn try_set_extra_server_trust_anchors(
&mut self,
certificates: impl IntoIterator<Item = CertificateDer<'static>>,
) -> Result<&mut TlsMitmEgressServerAuth, Box<dyn Error + Sync + Send>>
pub fn try_set_extra_server_trust_anchors( &mut self, certificates: impl IntoIterator<Item = CertificateDer<'static>>, ) -> Result<&mut TlsMitmEgressServerAuth, Box<dyn Error + Sync + Send>>
Add certificates to the configured upstream trust roots.
Trust settings are used only with ServerVerifyMode::Auto.
pub fn with_webpki_roots(self) -> TlsMitmEgressServerAuth
pub fn with_webpki_roots(self) -> TlsMitmEgressServerAuth
Use Rama’s bundled Mozilla roots for upstream verification.
Trust settings are used only with ServerVerifyMode::Auto.
pub fn set_webpki_roots(&mut self) -> &mut TlsMitmEgressServerAuth
pub fn set_webpki_roots(&mut self) -> &mut TlsMitmEgressServerAuth
Use Rama’s bundled Mozilla roots for upstream verification.
Trust settings are used only with ServerVerifyMode::Auto.
pub fn with_server_verify_cert_store(
self,
store: Arc<X509Store>,
) -> TlsMitmEgressServerAuth
pub fn with_server_verify_cert_store( self, store: Arc<X509Store>, ) -> TlsMitmEgressServerAuth
Set a BoringSSL certificate store for upstream verification.
The store takes precedence over the backend-neutral trust policy and is ignored when verification is explicitly disabled.
pub fn set_server_verify_cert_store(
&mut self,
store: Arc<X509Store>,
) -> &mut TlsMitmEgressServerAuth
pub fn set_server_verify_cert_store( &mut self, store: Arc<X509Store>, ) -> &mut TlsMitmEgressServerAuth
Set a BoringSSL certificate store for upstream verification.
The store takes precedence over the backend-neutral trust policy and is ignored when verification is explicitly disabled.
Trait Implementations§
§impl Clone for TlsMitmEgressServerAuth
impl Clone for TlsMitmEgressServerAuth
§fn clone(&self) -> TlsMitmEgressServerAuth
fn clone(&self) -> TlsMitmEgressServerAuth
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 TlsMitmEgressServerAuth
impl Debug for TlsMitmEgressServerAuth
§impl Default for TlsMitmEgressServerAuth
impl Default for TlsMitmEgressServerAuth
§fn default() -> TlsMitmEgressServerAuth
fn default() -> TlsMitmEgressServerAuth
Auto Trait Implementations§
impl Freeze for TlsMitmEgressServerAuth
impl RefUnwindSafe for TlsMitmEgressServerAuth
impl Send for TlsMitmEgressServerAuth
impl Sync for TlsMitmEgressServerAuth
impl Unpin for TlsMitmEgressServerAuth
impl UnsafeUnpin for TlsMitmEgressServerAuth
impl UnwindSafe for TlsMitmEgressServerAuth
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