pub struct CaRootsConfig { /* private fields */ }Expand description
Configures the trusted CA root certificates for non-iroh TLS connections.
These roots are used whenever iroh establishes standard TLS connections to external services, such as iroh relays, pkarr servers, or DNS-over-HTTPS resolvers.
The configured Certificate Authority (CA) roots are only used for verifying the validity of TLS certificates presented by those external services. These CAs don’t need to be trusted for the integrity or authenticity of native iroh connections, which rely on iroh’s own cryptographic authentication mechanisms.
Implementations§
Source§impl CaRootsConfig
impl CaRootsConfig
Sourcepub fn system() -> Self
Available on crate feature platform-verifier only.
pub fn system() -> Self
platform-verifier only.Use the operating system’s certificate facilities for verifying the validity of TLS certificates.
See [rustls_platform_verifier] for details how trust anchors are retrieved on different platforms.
Note: Additional certificates added via Self::with_extra_roots will be ignored on Android due to
missing support in [rustls].
Sourcepub fn embedded() -> Self
pub fn embedded() -> Self
Use a compiled-in copy of the root certificates trusted by Mozilla.
See [webpki_roots] for details.
Sourcepub fn insecure_skip_verify() -> Self
Available on crate features test-utils only.
pub fn insecure_skip_verify() -> Self
test-utils only.INSECURE: Do not verify server certificates at all.
May only be used in tests or local development setups.
Sourcepub fn custom(roots: impl IntoIterator<Item = CertificateDer<'static>>) -> Self
pub fn custom(roots: impl IntoIterator<Item = CertificateDer<'static>>) -> Self
Only trust the explicitly set root certificates.
Sourcepub fn with_extra_roots(
self,
extra_roots: impl IntoIterator<Item = CertificateDer<'static>>,
) -> Self
pub fn with_extra_roots( self, extra_roots: impl IntoIterator<Item = CertificateDer<'static>>, ) -> Self
Add additional root certificates to the list of trusted certificates.
Sourcepub fn server_cert_verifier(
&self,
crypto_provider: Arc<CryptoProvider>,
) -> Result<Arc<dyn ServerCertVerifier>>
pub fn server_cert_verifier( &self, crypto_provider: Arc<CryptoProvider>, ) -> Result<Arc<dyn ServerCertVerifier>>
Builds a [ServerCertVerifier] from this config.
Sourcepub fn client_config(
&self,
crypto_provider: Arc<CryptoProvider>,
) -> Result<ClientConfig>
pub fn client_config( &self, crypto_provider: Arc<CryptoProvider>, ) -> Result<ClientConfig>
Build a [ClientConfig] from this config.
Trait Implementations§
Source§impl Clone for CaRootsConfig
impl Clone for CaRootsConfig
Source§fn clone(&self) -> CaRootsConfig
fn clone(&self) -> CaRootsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CaRootsConfig
impl Debug for CaRootsConfig
Auto Trait Implementations§
impl Freeze for CaRootsConfig
impl RefUnwindSafe for CaRootsConfig
impl Send for CaRootsConfig
impl Sync for CaRootsConfig
impl Unpin for CaRootsConfig
impl UnwindSafe for CaRootsConfig
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<T> CompatExt for T
impl<T> CompatExt for T
§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