Tls

Struct Tls 

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

Fields related to a TLS connection. These fields focus on the TLS protocol itself and intentionally avoids in-depth analysis of the related x.509 certificate files.

Implementations§

Source§

impl Tls

Source

pub fn get_version(&self) -> Option<&String>

Numeric part of the version parsed from the original string.

Source

pub fn set_version(&mut self, version_arg: String)

Numeric part of the version parsed from the original string.

§Example

1.2

Source

pub fn get_version_protocol(&self) -> Option<&String>

Normalized lowercase protocol name parsed from original string.

Source

pub fn set_version_protocol(&mut self, version_protocol_arg: String)

Normalized lowercase protocol name parsed from original string.

§Example

tls

Source

pub fn get_cipher(&self) -> Option<&String>

String indicating the cipher used during the current connection.

Source

pub fn set_cipher(&mut self, cipher_arg: String)

String indicating the cipher used during the current connection.

§Example

TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256

Source

pub fn get_curve(&self) -> Option<&String>

String indicating the curve used for the given cipher, when applicable.

Source

pub fn set_curve(&mut self, curve_arg: String)

String indicating the curve used for the given cipher, when applicable.

§Example

secp256r1

Source

pub fn get_resumed(&self) -> Option<&bool>

Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation.

Source

pub fn set_resumed(&mut self, resumed_arg: bool)

Boolean flag indicating if this TLS connection was resumed from an existing TLS negotiation.

Source

pub fn get_established(&self) -> Option<&bool>

Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel.

Source

pub fn set_established(&mut self, established_arg: bool)

Boolean flag indicating if the TLS negotiation was successful and transitioned to an encrypted tunnel.

Source

pub fn get_next_protocol(&self) -> Option<&String>

String indicating the protocol being tunneled. Per the values in the IANA registry (https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case.

Source

pub fn set_next_protocol(&mut self, next_protocol_arg: String)

String indicating the protocol being tunneled. Per the values in the IANA registry (https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), this string should be lower case.

§Example

http/1.1

Source

pub fn get_client_ja3(&self) -> Option<&String>

A hash that identifies clients based on how they perform an SSL/TLS handshake.

Source

pub fn set_client_ja3(&mut self, client_ja3_arg: String)

A hash that identifies clients based on how they perform an SSL/TLS handshake.

§Example

d4e5b18d6b55c71272893221c96ba240

Source

pub fn get_client_server_name(&self) -> Option<&String>

Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. When this value is available, it should get copied to destination.domain.

Source

pub fn set_client_server_name(&mut self, client_server_name_arg: String)

Also called an SNI, this tells the server which hostname to which the client is attempting to connect to. When this value is available, it should get copied to destination.domain.

§Example

www.elastic.co

Source

pub fn get_client_supported_ciphers(&self) -> &Vec<String>

Array of ciphers offered by the client during the client hello.

Source

pub fn add_client_supported_cipher( &mut self, client_supported_cipher_arg: String, )

Array of ciphers offered by the client during the client hello.

§Example

["TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "..."]

Source

pub fn get_client_subject(&self) -> Option<&String>

Distinguished name of subject of the x.509 certificate presented by the client.

Source

pub fn set_client_subject(&mut self, client_subject_arg: String)

Distinguished name of subject of the x.509 certificate presented by the client.

§Example

CN=myclient, OU=Documentation Team, DC=example, DC=com

Source

pub fn get_client_issuer(&self) -> Option<&String>

Distinguished name of subject of the issuer of the x.509 certificate presented by the client.

Source

pub fn set_client_issuer(&mut self, client_issuer_arg: String)

Distinguished name of subject of the issuer of the x.509 certificate presented by the client.

§Example

CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com

Source

pub fn get_client_not_before(&self) -> Option<&Timestamp>

Date/Time indicating when client certificate is first considered valid.

Source

pub fn set_client_not_before(&mut self, client_not_before_arg: Timestamp)

Date/Time indicating when client certificate is first considered valid.

§Example

1970-01-01T00:00:00.000Z

Source

pub fn get_client_not_after(&self) -> Option<&Timestamp>

Date/Time indicating when client certificate is no longer considered valid.

Source

pub fn set_client_not_after(&mut self, client_not_after_arg: Timestamp)

Date/Time indicating when client certificate is no longer considered valid.

§Example

2021-01-01T00:00:00.000Z

Source

pub fn get_client_certificate_chain(&self) -> &Vec<String>

Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of client.certificate since that value should be the first certificate in the chain.

Source

pub fn add_client_certificate_chain( &mut self, client_certificate_chain_arg: String, )

Array of PEM-encoded certificates that make up the certificate chain offered by the client. This is usually mutually-exclusive of client.certificate since that value should be the first certificate in the chain.

§Example

["MII...", "MII..."]

Source

pub fn get_client_certificate(&self) -> Option<&String>

PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of client.certificate_chain since this value also exists in that list.

Source

pub fn set_client_certificate(&mut self, client_certificate_arg: String)

PEM-encoded stand-alone certificate offered by the client. This is usually mutually-exclusive of client.certificate_chain since this value also exists in that list.

§Example

MII...

Source

pub fn get_client_hash_md5(&self) -> Option<&String>

Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash.

Source

pub fn set_client_hash_md5(&mut self, client_hash_md5_arg: String)

Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash.

§Example

0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC

Source

pub fn get_client_hash_sha1(&self) -> Option<&String>

Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash.

Source

pub fn set_client_hash_sha1(&mut self, client_hash_sha1_arg: String)

Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash.

§Example

9E393D93138888D288266C2D915214D1D1CCEB2A

Source

pub fn get_client_hash_sha256(&self) -> Option<&String>

Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash.

Source

pub fn set_client_hash_sha256(&mut self, client_hash_sha256_arg: String)

Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the client. For consistency with other hash values, this value should be formatted as an uppercase hash.

§Example

0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0

Source

pub fn get_server_ja3s(&self) -> Option<&String>

A hash that identifies servers based on how they perform an SSL/TLS handshake.

Source

pub fn set_server_ja3s(&mut self, server_ja3s_arg: String)

A hash that identifies servers based on how they perform an SSL/TLS handshake.

§Example

394441ab65754e2207b1e1b457b3641d

Source

pub fn get_server_subject(&self) -> Option<&String>

Subject of the x.509 certificate presented by the server.

Source

pub fn set_server_subject(&mut self, server_subject_arg: String)

Subject of the x.509 certificate presented by the server.

§Example

CN=www.example.com, OU=Infrastructure Team, DC=example, DC=com

Source

pub fn get_server_issuer(&self) -> Option<&String>

Subject of the issuer of the x.509 certificate presented by the server.

Source

pub fn set_server_issuer(&mut self, server_issuer_arg: String)

Subject of the issuer of the x.509 certificate presented by the server.

§Example

CN=Example Root CA, OU=Infrastructure Team, DC=example, DC=com

Source

pub fn get_server_not_before(&self) -> Option<&Timestamp>

Timestamp indicating when server certificate is first considered valid.

Source

pub fn set_server_not_before(&mut self, server_not_before_arg: Timestamp)

Timestamp indicating when server certificate is first considered valid.

§Example

1970-01-01T00:00:00.000Z

Source

pub fn get_server_not_after(&self) -> Option<&Timestamp>

Timestamp indicating when server certificate is no longer considered valid.

Source

pub fn set_server_not_after(&mut self, server_not_after_arg: Timestamp)

Timestamp indicating when server certificate is no longer considered valid.

§Example

2021-01-01T00:00:00.000Z

Source

pub fn get_server_certificate_chain(&self) -> &Vec<String>

Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of server.certificate since that value should be the first certificate in the chain.

Source

pub fn add_server_certificate_chain( &mut self, server_certificate_chain_arg: String, )

Array of PEM-encoded certificates that make up the certificate chain offered by the server. This is usually mutually-exclusive of server.certificate since that value should be the first certificate in the chain.

§Example

["MII...", "MII..."]

Source

pub fn get_server_certificate(&self) -> Option<&String>

PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of server.certificate_chain since this value also exists in that list.

Source

pub fn set_server_certificate(&mut self, server_certificate_arg: String)

PEM-encoded stand-alone certificate offered by the server. This is usually mutually-exclusive of server.certificate_chain since this value also exists in that list.

§Example

MII...

Source

pub fn get_server_hash_md5(&self) -> Option<&String>

Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash.

Source

pub fn set_server_hash_md5(&mut self, server_hash_md5_arg: String)

Certificate fingerprint using the MD5 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash.

§Example

0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC

Source

pub fn get_server_hash_sha1(&self) -> Option<&String>

Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash.

Source

pub fn set_server_hash_sha1(&mut self, server_hash_sha1_arg: String)

Certificate fingerprint using the SHA1 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash.

§Example

9E393D93138888D288266C2D915214D1D1CCEB2A

Source

pub fn get_server_hash_sha256(&self) -> Option<&String>

Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash.

Source

pub fn set_server_hash_sha256(&mut self, server_hash_sha256_arg: String)

Certificate fingerprint using the SHA256 digest of DER-encoded version of certificate offered by the server. For consistency with other hash values, this value should be formatted as an uppercase hash.

§Example

0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0

Trait Implementations§

Source§

impl Clone for Tls

Source§

fn clone(&self) -> Tls

Returns a duplicate 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 Default for Tls

Source§

fn default() -> Tls

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

impl Serialize for Tls

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Tls

§

impl RefUnwindSafe for Tls

§

impl Send for Tls

§

impl Sync for Tls

§

impl Unpin for Tls

§

impl UnwindSafe for Tls

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§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

Source§

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>,

Source§

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.