Struct tcp_stream::RustlsConnectorConfig
source · [−]pub struct RustlsConnectorConfig(_);
Expand description
Reexport rustls-connector’s TlsConnector
Configuration helper for RustlsConnector
Implementations
sourceimpl RustlsConnectorConfig
impl RustlsConnectorConfig
Reexport rustls-connector’s TlsConnector
sourcepub fn new_with_webpki_roots_certs() -> RustlsConnectorConfig
pub fn new_with_webpki_roots_certs() -> RustlsConnectorConfig
Create a new RustlsConnectorConfig
using the webpki-roots certs (requires webpki-roots-certs 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<u8, Global>]
) -> (usize, usize)
pub fn add_parsable_certificates(
&mut self,
der_certs: &[Vec<u8, Global>]
) -> (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<Certificate, Global>,
key_der: PrivateKey
) -> Result<RustlsConnector, Error>
pub fn connector_with_single_cert(
self,
cert_chain: Vec<Certificate, Global>,
key_der: PrivateKey
) -> 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.
This function fails if key_der is invalid.
Trait Implementations
sourceimpl Clone for RustlsConnectorConfig
impl Clone for RustlsConnectorConfig
sourcefn clone(&self) -> RustlsConnectorConfig
fn clone(&self) -> RustlsConnectorConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for RustlsConnectorConfig
impl Default for RustlsConnectorConfig
sourcefn default() -> RustlsConnectorConfig
fn default() -> RustlsConnectorConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for RustlsConnectorConfig
impl Send for RustlsConnectorConfig
impl Sync for RustlsConnectorConfig
impl Unpin for RustlsConnectorConfig
impl UnwindSafe for RustlsConnectorConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more