Struct rustls_connector::RustlsConnectorConfig
source · pub struct RustlsConnectorConfig(/* private fields */);
Expand description
Configuration helper for RustlsConnector
Implementations§
source§impl RustlsConnectorConfig
impl RustlsConnectorConfig
sourcepub fn new_with_webpki_roots_certs() -> Self
pub fn new_with_webpki_roots_certs() -> Self
Create a new RustlsConnectorConfig
using the webpki-roots certs (requires webpki-roots-certs feature enabled)
sourcepub fn new_with_native_certs() -> Result<Self>
pub fn new_with_native_certs() -> Result<Self>
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<'_>>
) -> (usize, usize)
pub fn add_parsable_certificates( &mut self, der_certs: Vec<CertificateDer<'_>> ) -> (usize, usize)
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.
Returns the number of certificates added, and the number that were ignored.
sourcepub fn connector_with_no_client_auth(self) -> RustlsConnector
pub fn connector_with_no_client_auth(self) -> RustlsConnector
Create a new RustlsConnector
from this config and no client certificate
sourcepub fn connector_with_single_cert(
self,
cert_chain: Vec<CertificateDer<'static>>,
key_der: PrivateKeyDer<'static>
) -> Result<RustlsConnector>
pub fn connector_with_single_cert( self, cert_chain: Vec<CertificateDer<'static>>, key_der: PrivateKeyDer<'static> ) -> Result<RustlsConnector>
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.
This function fails 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