Struct wolfssl::SessionConfig

source ·
pub struct SessionConfig<IOCB: IOCallbacks> {
    pub io: IOCB,
    pub dtls_use_nonblock: Option<bool>,
    pub dtls_mtu: Option<u16>,
    pub server_name_indicator: Option<String>,
    pub checked_domain_name: Option<String>,
    pub keyshare_group: Option<CurveGroup>,
    pub dtls13_allow_ch_frag: Option<bool>,
    pub ssl_verify_mode: Option<SslVerifyMode>,
}
Expand description

Stores configurations we want to initialize a Session with.

Fields§

§io: IOCB

I/O callback handlers

§dtls_use_nonblock: Option<bool>

If set and the session is DTLS, sets the nonblocking mode.

§dtls_mtu: Option<u16>

If set and the session is DTLS, sets the MTU of the session.

If value exceeds wolfSSL’s MAX_RECORD_SIZE (currently 2^14), or is 0, ignored.

§server_name_indicator: Option<String>

If set, configures SNI (Server Name Indication) for the session with the given hostname.

§checked_domain_name: Option<String>

If set, configures the session to check the given domain against the peer certificate during connection.

§keyshare_group: Option<CurveGroup>

If set, specifies a curve group to use for key share

§dtls13_allow_ch_frag: Option<bool>

If set, specifies if fragmented ClientHello (CH) is allowed

§ssl_verify_mode: Option<SslVerifyMode>

SSL Verify mode

Implementations§

source§

impl<IOCB: IOCallbacks> SessionConfig<IOCB>

source

pub fn new(io: IOCB) -> Self

Creates a default Self. A set of IO callbacks implementing IOCallbacks must be provided.

source

pub fn when<F>(self, cond: bool, func: F) -> Self
where F: FnOnce(Self) -> Self,

When cond is True call func on Self

source

pub fn when_some<F, T>(self, maybe: Option<T>, func: F) -> Self
where F: FnOnce(Self, T) -> Self,

When maybe is Some(_) call func on Self and the contained value

source

pub fn with_dtls_nonblocking(self, is_nonblocking: bool) -> Self

source

pub fn with_dtls13_allow_ch_frag(self, allow: bool) -> Self

source

pub fn with_dtls_mtu(self, mtu: u16) -> Self

source

pub fn with_sni(self, hostname: &str) -> Self

source

pub fn with_checked_domain_name(self, domain: &str) -> Self

source

pub fn with_keyshare_group(self, curve: CurveGroup) -> Self

source

pub fn with_ssl_verify_mode(self, mode: SslVerifyMode) -> Self

Auto Trait Implementations§

§

impl<IOCB> Freeze for SessionConfig<IOCB>
where IOCB: Freeze,

§

impl<IOCB> RefUnwindSafe for SessionConfig<IOCB>
where IOCB: RefUnwindSafe,

§

impl<IOCB> Send for SessionConfig<IOCB>
where IOCB: Send,

§

impl<IOCB> Sync for SessionConfig<IOCB>
where IOCB: Sync,

§

impl<IOCB> Unpin for SessionConfig<IOCB>
where IOCB: Unpin,

§

impl<IOCB> UnwindSafe for SessionConfig<IOCB>
where IOCB: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Error = Infallible

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

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

Performs the conversion.
source§

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.
source§

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

Performs the conversion.