pub struct SslSession(/* private fields */);
Expand description
An encoded SSL session.
These can be cached to share sessions across connections.
Implementations§
Source§impl SslSession
impl SslSession
Sourcepub fn from_der(der: &[u8]) -> Result<SslSession, ErrorStack>
pub fn from_der(der: &[u8]) -> Result<SslSession, ErrorStack>
Deserializes a DER-encoded session structure.
This corresponds to d2i_SSL_SESSION
.
Methods from Deref<Target = SslSessionRef>§
Sourcepub fn id(&self) -> &[u8] ⓘ
pub fn id(&self) -> &[u8] ⓘ
Returns the SSL session ID.
This corresponds to SSL_SESSION_get_id
.
Sourcepub fn master_key_len(&self) -> usize
pub fn master_key_len(&self) -> usize
Returns the length of the master key.
This corresponds to SSL_SESSION_get_master_key
.
Sourcepub fn master_key(&self, buf: &mut [u8]) -> usize
pub fn master_key(&self, buf: &mut [u8]) -> usize
Copies the master key into the provided buffer.
Returns the number of bytes written, or the size of the master key if the buffer is empty.
This corresponds to SSL_SESSION_get_master_key
.
Sourcepub fn max_early_data(&self) -> u32
pub fn max_early_data(&self) -> u32
Gets the maximum amount of early data that can be sent on this session.
Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
This corresponds to SSL_SESSION_get_max_early_data
.
Sourcepub fn time(&self) -> i32
pub fn time(&self) -> i32
Returns the time at which the session was established, in seconds since the Unix epoch.
This corresponds to SSL_SESSION_get_time
.
Sourcepub fn timeout(&self) -> i64
pub fn timeout(&self) -> i64
Returns the sessions timeout, in seconds.
A session older than this time should not be used for session resumption.
This corresponds to SSL_SESSION_get_timeout
.
Sourcepub fn protocol_version(&self) -> SslVersion
pub fn protocol_version(&self) -> SslVersion
Returns the session’s TLS protocol version.
Requires OpenSSL 1.1.0 or LibreSSL 2.7.0 or newer.
This corresponds to SSL_SESSION_get_protocol_version
.
Sourcepub fn to_der(&self) -> Result<Vec<u8>, ErrorStack>
pub fn to_der(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the session into a DER-encoded structure.
This corresponds to i2d_SSL_SESSION
.
Trait Implementations§
Source§impl AsRef<SslSessionRef> for SslSession
impl AsRef<SslSessionRef> for SslSession
Source§fn as_ref(&self) -> &SslSessionRef
fn as_ref(&self) -> &SslSessionRef
Source§impl Borrow<SslSessionRef> for SslSession
impl Borrow<SslSessionRef> for SslSession
Source§fn borrow(&self) -> &SslSessionRef
fn borrow(&self) -> &SslSessionRef
Source§impl Clone for SslSession
impl Clone for SslSession
Source§fn clone(&self) -> SslSession
fn clone(&self) -> SslSession
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Deref for SslSession
impl Deref for SslSession
Source§type Target = SslSessionRef
type Target = SslSessionRef
Source§fn deref(&self) -> &SslSessionRef
fn deref(&self) -> &SslSessionRef
Source§impl DerefMut for SslSession
impl DerefMut for SslSession
Source§fn deref_mut(&mut self) -> &mut SslSessionRef
fn deref_mut(&mut self) -> &mut SslSessionRef
Source§impl Drop for SslSession
impl Drop for SslSession
Source§impl ForeignType for SslSession
impl ForeignType for SslSession
Source§type CType = SSL_SESSION
type CType = SSL_SESSION
Source§type Ref = SslSessionRef
type Ref = SslSessionRef
Source§unsafe fn from_ptr(ptr: *mut SSL_SESSION) -> SslSession
unsafe fn from_ptr(ptr: *mut SSL_SESSION) -> SslSession
Source§fn as_ptr(&self) -> *mut SSL_SESSION
fn as_ptr(&self) -> *mut SSL_SESSION
impl Send for SslSession
impl Sync for SslSession
Auto Trait Implementations§
impl Freeze for SslSession
impl RefUnwindSafe for SslSession
impl Unpin for SslSession
impl UnwindSafe for SslSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)