Struct s2n_quic_tls::client::Builder
source · pub struct Builder { /* private fields */ }
Implementations§
source§impl Builder
impl Builder
pub fn config_mut(&mut self) -> &mut Builder
pub fn with_application_protocols<P: IntoIterator<Item = I>, I: AsRef<[u8]>>( self, protocols: P ) -> Result<Self, Error>
pub fn with_certificate<C: IntoCertificate>( self, certificate: C ) -> Result<Self, Error>
sourcepub fn with_empty_trust_store(self) -> Result<Self, Error>
pub fn with_empty_trust_store(self) -> Result<Self, Error>
Clears the default trust store for this client
By default, the trust store is initialized with common trust store locations for the host operating system. By invoking this method, the trust store will be cleared.
Note that call ordering matters. The caller should call this
method before making any calls to with_trust_client_certificate_signed_by()
.
Calling this method after a method that modifies the trust store will clear it.
sourcepub fn with_client_identity<C: IntoCertificate, PK: IntoPrivateKey>(
self,
certificate: C,
private_key: PK
) -> Result<Self, Error>
pub fn with_client_identity<C: IntoCertificate, PK: IntoPrivateKey>( self, certificate: C, private_key: PK ) -> Result<Self, Error>
Add the cert and key to the key store.
This must be set when the server requires client authentication (mutual TLS). The client will offer the certificate to the server when it is requested as part of the TLS handshake.
sourcepub fn with_verify_host_name_callback<T: 'static + VerifyHostNameCallback>(
self,
handler: T
) -> Result<Self, Error>
pub fn with_verify_host_name_callback<T: 'static + VerifyHostNameCallback>( self, handler: T ) -> Result<Self, Error>
Set the host name verification callback.
This will be invoked when a server certificate is presented during a TLS handshake. If this function is invoked, the default server name validation logic is disabled; this should only be used in very specific cases where normal TLS hostname validation is not appropriate.