Struct openssl::ssl::SslRef
[−]
[src]
pub struct SslRef<'a>(_, _);
Methods
impl<'a> SslRef<'a>
[src]
unsafe fn from_ptr(ssl: *mut SSL) -> SslRef<'a>
fn as_ptr(&self) -> *mut SSL
fn set_verify(&mut self, mode: SslVerifyMode)
Sets the verification mode to be used during the handshake process.
Use set_verify_callback
to additionally add a callback.
fn set_verify_callback<F>(&mut self, mode: SslVerifyMode, verify: F) where F: Fn(bool, &X509StoreContext) -> bool + Any + 'static + Sync + Send
Sets the certificate verification callback to be used during the handshake process.
The callback is provided with a boolean indicating if the
preveification process was successful, and an object providing access
to the certificate chain. It should return true
if the certificate
chain is valid and false
otherwise.
fn current_cipher(&self) -> Option<SslCipher<'a>>
fn state_string(&self) -> &'static str
fn state_string_long(&self) -> &'static str
fn set_hostname(&mut self, hostname: &str) -> Result<(), ErrorStack>
Sets the host name to be used with SNI (Server Name Indication).
fn peer_certificate(&self) -> Option<X509>
Returns the certificate of the peer, if present.
fn version(&self) -> &'static str
Returns the name of the protocol used for the connection, e.g. "TLSv1.2", "SSLv3", etc.
fn selected_npn_protocol(&self) -> Option<&[u8]>
Returns the protocol selected by performing Next Protocol Negotiation, if any.
The protocol's name is returned is an opaque sequence of bytes. It is up to the client to interpret it.
This method needs the npn
feature.
fn selected_alpn_protocol(&self) -> Option<&[u8]>
Returns the protocol selected by performing ALPN, if any.
The protocol's name is returned is an opaque sequence of bytes. It is up to the client to interpret it.
This method needs the alpn
feature.
fn pending(&self) -> usize
Returns the number of bytes remaining in the currently processed TLS record.
fn compression(&self) -> Option<String>
Returns the compression currently in use.
The result will be either None, indicating no compression is in use, or a string with the compression name.
fn ssl_method(&self) -> SslMethod
fn servername(&self) -> Option<String>
Returns the server's name for the current connection
fn set_ssl_context(&mut self, ctx: &SslContextRef) -> Result<(), ErrorStack>
Changes the context corresponding to the current connection.
fn ssl_context(&self) -> SslContextRef<'a>
Returns the context corresponding to the current connection