pub struct ForwardedClientCert { /* private fields */ }Expand description
Where a trusted proxy forwards the client certificate it verified, and which peers are trusted to forward one.
Give it to MutualTlsAuthInterceptor::with_forwarded.
A certificate from the connection’s own TLS handshake is used first; the
header is read only when there is none, and only when the connection’s
peer address is in one of trusted. With trusted empty no header is
ever believed.
The proxy is what verified the certificate: it must require and verify
client certificates, and it must replace a header of this name the
client sent rather than pass it through (Envoy’s
forward_client_cert_details: SANITIZE_SET, nginx’s proxy_set_header,
which always replaces; the load balancer replaces its x-amzn- headers).
Only the leaf certificate is read.
Implementations§
Source§impl ForwardedClientCert
impl ForwardedClientCert
Sourcepub fn envoy(
trusted: impl IntoIterator<Item = TrustedProxy>,
) -> ForwardedClientCert
pub fn envoy( trusted: impl IntoIterator<Item = TrustedProxy>, ) -> ForwardedClientCert
Envoy’s (and Istio’s) x-forwarded-client-cert, with Cert among its
details (set_current_client_cert_details: { cert: true }), from a peer
in trusted.
Sourcepub fn url_encoded_pem(
header: impl Into<String>,
trusted: impl IntoIterator<Item = TrustedProxy>,
) -> ForwardedClientCert
pub fn url_encoded_pem( header: impl Into<String>, trusted: impl IntoIterator<Item = TrustedProxy>, ) -> ForwardedClientCert
The URL-encoded PEM certificate in header, from a peer in trusted:
nginx’s proxy_set_header X-SSL-Client-Cert $ssl_client_escaped_cert;
with header "x-ssl-client-cert" (any case).
Sourcepub fn aws_alb(
trusted: impl IntoIterator<Item = TrustedProxy>,
) -> ForwardedClientCert
pub fn aws_alb( trusted: impl IntoIterator<Item = TrustedProxy>, ) -> ForwardedClientCert
An AWS Application Load Balancer’s x-amzn-mtls-clientcert, from a
peer in trusted (the load balancer’s subnets).
Sourcepub fn certificate(&self, ctx: &CallContext) -> Option<Vec<u8>>
pub fn certificate(&self, ctx: &CallContext) -> Option<Vec<u8>>
The DER of the certificate the header carries, when the connection came from a trusted proxy and the header holds one that decodes.
Trait Implementations§
Source§impl Clone for ForwardedClientCert
impl Clone for ForwardedClientCert
Source§fn clone(&self) -> ForwardedClientCert
fn clone(&self) -> ForwardedClientCert
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ForwardedClientCert
impl Debug for ForwardedClientCert
impl Eq for ForwardedClientCert
Source§impl PartialEq for ForwardedClientCert
impl PartialEq for ForwardedClientCert
impl StructuralPartialEq for ForwardedClientCert
Auto Trait Implementations§
impl Forget for ForwardedClientCert
impl Freeze for ForwardedClientCert
impl Move for ForwardedClientCert
impl RefUnwindSafe for ForwardedClientCert
impl Send for ForwardedClientCert
impl Sync for ForwardedClientCert
impl Unpin for ForwardedClientCert
impl UnsafeUnpin for ForwardedClientCert
impl UnwindSafe for ForwardedClientCert
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§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 tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].