TlsConfigBuilder

Struct TlsConfigBuilder 

Source
pub struct TlsConfigBuilder { /* private fields */ }
Expand description

Builder for TlsClientConfig.

Implementations§

Source§

impl TlsConfigBuilder

Source

pub fn server_name(self, server_name: ServerName) -> Self

Sets the server name.

Source

pub fn root_store(self, store: RootCertStore) -> Self

Sets the root certificates to use for verifying the server’s certificate.

Source

pub fn client_auth(self, cert_key: (Vec<CertificateDer>, PrivateKeyDer)) -> Self

Sets a DER-encoded certificate chain and a matching private key for client authentication.

Often the chain will consist of a single end-entity certificate.

§Arguments
  • cert_key - A tuple containing the certificate chain and the private key.

    • Each certificate in the chain must be in the X.509 format.
    • The key must be in the ASN.1 format (either PKCS#8 or PKCS#1).
Source

pub fn build(self) -> Result<TlsClientConfig, TlsConfigError>

Builds the TLS configuration.

Trait Implementations§

Source§

impl Debug for TlsConfigBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TlsConfigBuilder

Source§

fn default() -> TlsConfigBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for TlsConfigBuilder

§

impl RefUnwindSafe for TlsConfigBuilder

§

impl Send for TlsConfigBuilder

§

impl Sync for TlsConfigBuilder

§

impl Unpin for TlsConfigBuilder

§

impl UnwindSafe for TlsConfigBuilder

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more