Struct proxy_header::SslInfo

source ·
pub struct SslInfo<'a>(/* private fields */);
Expand description

SSL information from a PROXY protocol header

Implementations§

source§

impl<'a> SslInfo<'a>

source

pub fn new( client_ssl: bool, client_cert_conn: bool, client_cert_sess: bool, verify: u32, ) -> Self

Create a new SSL information struct

source

pub fn client_ssl(&self) -> bool

Client connected over SSL/TLS

The PP2_CLIENT_SSL flag indicates that the client connected over SSL/TLS. When this field is present, the US-ASCII string representation of the TLS version is appended at the end of the field in the TLV format using the type PP2_SUBTYPE_SSL_VERSION.

source

pub fn client_cert_conn(&self) -> bool

Client certificate presented in the connection

PP2_CLIENT_CERT_CONN indicates that the client provided a certificate over the current connection.

source

pub fn client_cert_sess(&self) -> bool

Client certificate presented in the session

PP2_CLIENT_CERT_SESS indicates that the client provided a certificate at least once over the TLS session this connection belongs to.

source

pub fn verify(&self) -> u32

Whether the certificate was verified

The verify field will be zero if the client presented a certificate and it was successfully verified, and non-zero otherwise.

source

pub fn tlvs(&self) -> Tlvs<'_>

Iterator over all TLV (type-length-value) fields

source

pub fn version(&self) -> Option<&str>

SSL version

See Tlv::SslVersion for more information.

source

pub fn cn(&self) -> Option<&str>

SSL CN

See Tlv::SslCn for more information.

source

pub fn cipher(&self) -> Option<&str>

SSL cipher

See Tlv::SslCipher for more information.

source

pub fn sig_alg(&self) -> Option<&str>

SSL signature algorithm

See Tlv::SslSigAlg for more information.

source

pub fn key_alg(&self) -> Option<&str>

SSL key algorithm

See Tlv::SslKeyAlg for more information.

source

pub fn into_owned(self) -> SslInfo<'static>

Returns an owned version of this struct

source

pub fn append_tlv(&mut self, tlv: Tlv<'_>)

Appends an additional sub-TLV field

See ProxyHeader::append_tlv for more information.

Trait Implementations§

source§

impl<'a> Clone for SslInfo<'a>

source§

fn clone(&self) -> SslInfo<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SslInfo<'_>

source§

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

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

impl<'a> PartialEq for SslInfo<'a>

source§

fn eq(&self, other: &SslInfo<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Eq for SslInfo<'a>

source§

impl<'a> StructuralPartialEq for SslInfo<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for SslInfo<'a>

§

impl<'a> RefUnwindSafe for SslInfo<'a>

§

impl<'a> Send for SslInfo<'a>

§

impl<'a> Sync for SslInfo<'a>

§

impl<'a> Unpin for SslInfo<'a>

§

impl<'a> UnwindSafe for SslInfo<'a>

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.