pub struct ClientConfig<C: CryptoProvider> { /* private fields */ }Expand description
Configuration for a TLS 1.3 client connection.
Created via ClientConfig::new with a CryptoProvider. The provider
supplies all cryptographic primitives (AEAD, key exchange, signatures)
and certificate validation.
By default only X.509 certificates are negotiated. Call
with_certificate_types to also accept
RawPublicKey certificates (RFC 7250).
Implementations§
Source§impl<C: CryptoProvider> ClientConfig<C>
impl<C: CryptoProvider> ClientConfig<C>
Sourcepub fn new(crypto_provider: C) -> Self
pub fn new(crypto_provider: C) -> Self
Create a new client configuration backed by the given crypto provider.
The initial configuration accepts X.509 certificates only.
Sourcepub fn with_certificate_types(self, types: &[CertType]) -> Result<Self, Error>
pub fn with_certificate_types(self, types: &[CertType]) -> Result<Self, Error>
Set the set of acceptable certificate types.
The default is [CertType::X509]. To also negotiate raw public keys
(RFC 7250), pass &[CertType::X509, CertType::RawPublicKey].
§Errors
Returns Error::InvalidConfiguration when more than two types are
supplied.
Trait Implementations§
Source§impl<C: Clone + CryptoProvider> Clone for ClientConfig<C>
impl<C: Clone + CryptoProvider> Clone for ClientConfig<C>
Source§fn clone(&self) -> ClientConfig<C>
fn clone(&self) -> ClientConfig<C>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<C> Freeze for ClientConfig<C>where
C: Freeze,
impl<C> RefUnwindSafe for ClientConfig<C>where
C: RefUnwindSafe,
impl<C> Send for ClientConfig<C>
impl<C> Sync for ClientConfig<C>
impl<C> Unpin for ClientConfig<C>where
C: Unpin,
impl<C> UnsafeUnpin for ClientConfig<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for ClientConfig<C>where
C: UnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more