Struct PlatformTrustPolicy
#[non_exhaustive]pub struct PlatformTrustPolicy { /* private fields */ }tls only.Expand description
Settings for the platform verifier used by ServerTrustSource::Platform.
The operating system verifier determines system trust. With the
native-certs feature, a reload policy on supported targets refreshes
only extra anchors supplied through SSL_CERT_EXTRA_FILE and
SSL_CERT_EXTRA_DIR. On other targets a reload policy refreshes the full
native root store, including its environment configuration.
Configure this policy once and clone it so callers share its reload state and can reuse pooled connections. Refreshes apply to new handshakes. Established pooled connections can continue serving requests until they close. Rama’s rustls and BoringSSL connectors, including their QUIC providers, apply this policy. A custom verifier controls its own trust decisions.
Implementations§
§impl PlatformTrustPolicy
impl PlatformTrustPolicy
pub fn with_reload_trigger<T>(
self,
trigger: impl IntoNativeTrustReloadTrigger<T>,
) -> PlatformTrustPolicy
Available on crate feature boring only.
pub fn with_reload_trigger<T>( self, trigger: impl IntoNativeTrustReloadTrigger<T>, ) -> PlatformTrustPolicy
boring only.Refresh trust roots when the trigger fires.
On targets with an operating system verifier, refresh only
SSL_CERT_EXTRA_FILE and SSL_CERT_EXTRA_DIR. Use
NativeTrustStoreChanges::extra_roots
to watch these settings. On macOS, Keychain lookup remains part of
operating system verification.
On targets without an operating system verifier, refresh the full native store. A trigger stream requests a refresh and the platform decides which roots the policy reloads.
pub fn set_reload_trigger<T>(
&mut self,
trigger: impl IntoNativeTrustReloadTrigger<T>,
) -> &mut PlatformTrustPolicy
Available on crate feature boring only.
pub fn set_reload_trigger<T>( &mut self, trigger: impl IntoNativeTrustReloadTrigger<T>, ) -> &mut PlatformTrustPolicy
boring only.Refresh trust roots when the trigger fires.
On targets with an operating system verifier, refresh only
SSL_CERT_EXTRA_FILE and SSL_CERT_EXTRA_DIR. Use
NativeTrustStoreChanges::extra_roots
to watch these settings. On macOS, Keychain lookup remains part of
operating system verification.
On targets without an operating system verifier, refresh the full native store. A trigger stream requests a refresh and the platform decides which roots the policy reloads.
pub fn maybe_with_max_age(
self,
max_age: Option<Duration>,
) -> PlatformTrustPolicy
Available on crate feature boring only.
pub fn maybe_with_max_age( self, max_age: Option<Duration>, ) -> PlatformTrustPolicy
boring only.Limit how long a handshake may rely on its trust snapshot.
The limit applies to environment-supplied extra roots when an operating system verifier is available, or the full native snapshot on other targets. At the limit, the handshake requires a successful read. With a limit of zero, this applies to every handshake.
pub fn maybe_set_max_age(
&mut self,
max_age: Option<Duration>,
) -> &mut PlatformTrustPolicy
Available on crate feature boring only.
pub fn maybe_set_max_age( &mut self, max_age: Option<Duration>, ) -> &mut PlatformTrustPolicy
boring only.Limit how long a handshake may rely on its trust snapshot.
The limit applies to environment-supplied extra roots when an operating system verifier is available, or the full native snapshot on other targets. At the limit, the handshake requires a successful read. With a limit of zero, this applies to every handshake.
pub fn with_max_age(self, max_age: Duration) -> PlatformTrustPolicy
Available on crate feature boring only.
pub fn with_max_age(self, max_age: Duration) -> PlatformTrustPolicy
boring only.Limit how long a handshake may rely on its trust snapshot.
The limit applies to environment-supplied extra roots when an operating system verifier is available, or the full native snapshot on other targets. At the limit, the handshake requires a successful read. With a limit of zero, this applies to every handshake.
pub fn set_max_age(&mut self, max_age: Duration) -> &mut PlatformTrustPolicy
Available on crate feature boring only.
pub fn set_max_age(&mut self, max_age: Duration) -> &mut PlatformTrustPolicy
boring only.Limit how long a handshake may rely on its trust snapshot.
The limit applies to environment-supplied extra roots when an operating system verifier is available, or the full native snapshot on other targets. At the limit, the handshake requires a successful read. With a limit of zero, this applies to every handshake.
pub fn without_max_age(self) -> PlatformTrustPolicy
Available on crate feature boring only.
pub fn without_max_age(self) -> PlatformTrustPolicy
boring only.Limit how long a handshake may rely on its trust snapshot.
The limit applies to environment-supplied extra roots when an operating system verifier is available, or the full native snapshot on other targets. At the limit, the handshake requires a successful read. With a limit of zero, this applies to every handshake.
pub fn unset_max_age(&mut self) -> &mut PlatformTrustPolicy
Available on crate feature boring only.
pub fn unset_max_age(&mut self) -> &mut PlatformTrustPolicy
boring only.Limit how long a handshake may rely on its trust snapshot.
The limit applies to environment-supplied extra roots when an operating system verifier is available, or the full native snapshot on other targets. At the limit, the handshake requires a successful read. With a limit of zero, this applies to every handshake.
§impl PlatformTrustPolicy
impl PlatformTrustPolicy
pub const fn new() -> PlatformTrustPolicy
Available on crate feature boring only.
pub const fn new() -> PlatformTrustPolicy
boring only.Use the operating system verifier, or static native roots if unavailable.
Trait Implementations§
§impl Clone for PlatformTrustPolicy
impl Clone for PlatformTrustPolicy
§fn clone(&self) -> PlatformTrustPolicy
fn clone(&self) -> PlatformTrustPolicy
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 PlatformTrustPolicy
impl Debug for PlatformTrustPolicy
§impl Default for PlatformTrustPolicy
impl Default for PlatformTrustPolicy
§fn default() -> PlatformTrustPolicy
fn default() -> PlatformTrustPolicy
impl Eq for PlatformTrustPolicy
§impl From<PlatformTrustPolicy> for TlsServerTrust
impl From<PlatformTrustPolicy> for TlsServerTrust
§fn from(policy: PlatformTrustPolicy) -> TlsServerTrust
fn from(policy: PlatformTrustPolicy) -> TlsServerTrust
§impl Hash for PlatformTrustPolicy
impl Hash for PlatformTrustPolicy
§impl PartialEq for PlatformTrustPolicy
impl PartialEq for PlatformTrustPolicy
impl StructuralPartialEq for PlatformTrustPolicy
Auto Trait Implementations§
impl !RefUnwindSafe for PlatformTrustPolicy
impl !UnwindSafe for PlatformTrustPolicy
impl Forget for PlatformTrustPolicy
impl Freeze for PlatformTrustPolicy
impl Move for PlatformTrustPolicy
impl Send for PlatformTrustPolicy
impl Sync for PlatformTrustPolicy
impl Unpin for PlatformTrustPolicy
impl UnsafeUnpin for PlatformTrustPolicy
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<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