Enum HandshakeRelayClassification
pub enum HandshakeRelayClassification {
Unclassified,
Transport,
TlsProtocol,
CertTrust,
}boring only.Expand description
Classification of a handshake-time failure.
Designed so callers can mix-and-match against direction (via
TlsMitmRelayError::direction) to express policy. The intended
shape for an MITM relay caching SNI bypass exceptions is:
match (err.kind(), err.direction()) {
(TlsMitmRelayErrorKind::Handshake {
classification: HandshakeRelayClassification::CertTrust, ..
}, Some(TlsMitmRelayErrorDirection::Ingress)) => {
// peer's trust store doesn't include our CA — cache SNI bypass
}
_ => { /* don't cache; log/event per classification */ }
}Variants§
Unclassified
No recognizable signal (e.g. builder-style error with no SSL
code, no io::Error, no error stack).
Transport
Transport-layer failure during handshake. Covers both real
io::Errors (TCP RST, ECONNRESET, broken pipe, EOF with errno)
and the SSL_ERROR_SYSCALL-with-empty-error-queue case
(peer FIN’d mid-handshake without sending a TLS alert). In
neither case did the peer engage with us at TLS protocol
layer.
TlsProtocol
Peer / library engaged at TLS protocol layer and the handshake
failed there. Covers any peer-sent alert (handshake_failure,
protocol_version, decrypt_error, internal_error, …),
any library protocol error (WRONG_VERSION_NUMBER,
NO_SHARED_CIPHER, DOWNGRADE_DETECTED, …), and any
cert-shaped error that is not a trust outcome — cert format,
protocol, or config mismatches (CERT_LENGTH_MISMATCH,
BAD_ECC_CERT, CERTIFICATE_AND_PRIVATE_KEY_MISMATCH,
UNSUPPORTED_CERTIFICATE, CERTIFICATE_REQUIRED, …).
CertTrust
Trust-outcome failure: the peer’s TLS stack rejected our cert chain as untrusted, or our local verifier rejected the peer’s chain. Matches:
- Peer alerts that signal trust validation failure:
unknown_ca,bad_certificate,certificate_expired,certificate_revoked,certificate_unknown. - Library validation outcomes:
CERTIFICATE_VERIFY_FAILED,NO_MATCHING_ISSUER(and OpenSSL-compatible*untrusted*).
This is the only classification where caching an SNI bypass exception is meaningful — it indicates a structural trust mismatch (e.g. our managed CA is not in the peer’s trust store) that will not clear up on retry.
Trait Implementations§
§impl Clone for HandshakeRelayClassification
impl Clone for HandshakeRelayClassification
§fn clone(&self) -> HandshakeRelayClassification
fn clone(&self) -> HandshakeRelayClassification
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 HandshakeRelayClassification
impl Debug for HandshakeRelayClassification
§impl PartialEq for HandshakeRelayClassification
impl PartialEq for HandshakeRelayClassification
§fn eq(&self, other: &HandshakeRelayClassification) -> bool
fn eq(&self, other: &HandshakeRelayClassification) -> bool
self and other values to be equal, and is used by ==.impl Copy for HandshakeRelayClassification
impl Eq for HandshakeRelayClassification
impl StructuralPartialEq for HandshakeRelayClassification
Auto Trait Implementations§
impl Freeze for HandshakeRelayClassification
impl RefUnwindSafe for HandshakeRelayClassification
impl Send for HandshakeRelayClassification
impl Sync for HandshakeRelayClassification
impl Unpin for HandshakeRelayClassification
impl UnsafeUnpin for HandshakeRelayClassification
impl UnwindSafe for HandshakeRelayClassification
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
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
key and return true if they are equal.§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
§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<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