pub struct RustlsConnectorConfig { /* private fields */ }Expand description
Reexport rustls-connector’s TlsConnector
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<'a>(
&mut self,
der_certs: Vec<CertificateDer<'static>>,
)
pub fn add_parsable_certificates<'a>( &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_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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more