pub struct RustlsConnectorConfig { /* private fields */ }Expand description
Configuration helper for RustlsConnector
Implementations§
Source§impl RustlsConnectorConfig
impl RustlsConnectorConfig
Sourcepub fn new_with_webpki_root_certs() -> RustlsConnectorConfig
pub fn new_with_webpki_root_certs() -> RustlsConnectorConfig
Create a new RustlsConnectorConfig using the webpki-root-certs (requires webpki-root-certs feature enabled)
Sourcepub fn new_with_platform_verifier() -> RustlsConnectorConfig
pub fn new_with_platform_verifier() -> RustlsConnectorConfig
Create a new RustlsConnectorConfig using the rustls-platform-verifier mechanism (requires platform-verifier feature enabled)
Sourcepub fn new_with_native_certs() -> Result<RustlsConnectorConfig, Error>
pub fn new_with_native_certs() -> Result<RustlsConnectorConfig, Error>
Create a new RustlsConnectorConfig using the system certs (requires native-certs feature enabled)
§Errors
Returns an error if we fail to load the native certs.
Sourcepub fn add_parsable_certificates(
&mut self,
der_certs: Vec<CertificateDer<'static>>,
)
pub fn add_parsable_certificates( &mut self, der_certs: Vec<CertificateDer<'static>>, )
Parse the given DER-encoded certificates and add all that can be parsed in a best-effort fashion.
This is because large collections of root certificates often include ancient or syntactically invalid certificates.
Sourcepub fn with_parsable_certificates(
self,
der_certs: Vec<CertificateDer<'static>>,
) -> RustlsConnectorConfig
pub fn with_parsable_certificates( self, der_certs: Vec<CertificateDer<'static>>, ) -> RustlsConnectorConfig
Parse the given DER-encoded certificates and add all that can be parsed in a best-effort fashion.
This is because large collections of root certificates often include ancient or syntactically invalid certificates.
Sourcepub fn with_webpki_root_certs(self) -> RustlsConnectorConfig
pub fn with_webpki_root_certs(self) -> RustlsConnectorConfig
Add certs from webpki-root-certs (requires webpki-root-certs feature enabled)
Sourcepub fn with_platform_verifier(self) -> RustlsConnectorConfig
pub fn with_platform_verifier(self) -> RustlsConnectorConfig
Use the rustls-platform-verifier mechanism (requires platform-verifier feature enabled)
Sourcepub fn with_native_certs(self) -> Result<RustlsConnectorConfig, Error>
pub fn with_native_certs(self) -> Result<RustlsConnectorConfig, Error>
Add the system certs (requires native-certs feature enabled)
§Errors
Returns an error if we fail to load the native certs.
Sourcepub fn connector_with_no_client_auth(self) -> Result<RustlsConnector, Error>
pub fn connector_with_no_client_auth(self) -> Result<RustlsConnector, Error>
Create a new RustlsConnector from this config and no client certificate
§Errors
Returns an error if we fail to init our verifier
Sourcepub fn connector_with_single_cert(
self,
cert_chain: Vec<CertificateDer<'static>>,
key_der: PrivateKeyDer<'static>,
) -> Result<RustlsConnector, Error>
pub fn connector_with_single_cert( self, cert_chain: Vec<CertificateDer<'static>>, key_der: PrivateKeyDer<'static>, ) -> Result<RustlsConnector, Error>
Create a new RustlsConnector from this config and the given client certificate
cert_chain is a vector of DER-encoded certificates. key_der is a DER-encoded RSA, ECDSA, or Ed25519 private key.
§Errors
Returns an error if we fail to init our verifier or if key_der is invalid.
Trait Implementations§
Source§impl Clone for RustlsConnectorConfig
impl Clone for RustlsConnectorConfig
Source§fn clone(&self) -> RustlsConnectorConfig
fn clone(&self) -> RustlsConnectorConfig
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 RustlsConnectorConfig
impl Debug for RustlsConnectorConfig
Source§impl Default for RustlsConnectorConfig
impl Default for RustlsConnectorConfig
Source§fn default() -> RustlsConnectorConfig
fn default() -> RustlsConnectorConfig
Auto Trait Implementations§
impl Freeze for RustlsConnectorConfig
impl RefUnwindSafe for RustlsConnectorConfig
impl Send for RustlsConnectorConfig
impl Sync for RustlsConnectorConfig
impl Unpin for RustlsConnectorConfig
impl UnsafeUnpin for RustlsConnectorConfig
impl UnwindSafe for RustlsConnectorConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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