Struct openssl::ssl::SslRef
[−]
pub struct SslRef(_);
Methods
impl SslRef
[src]
fn set_verify(&mut self, mode: SslVerifyMode)
[src]
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, &X509StoreContextRef) -> bool + Any + 'static + Sync + Send,
[src]
F: Fn(bool, &X509StoreContextRef) -> 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 set_tmp_dh(&mut self, dh: &DhRef) -> Result<(), ErrorStack>
[src]
fn set_tmp_dh_callback<F>(&mut self, callback: F) where
F: Fn(&mut SslRef, bool, u32) -> Result<Dh, ErrorStack> + Any + 'static + Sync + Send,
[src]
F: Fn(&mut SslRef, bool, u32) -> Result<Dh, ErrorStack> + Any + 'static + Sync + Send,
fn set_tmp_ecdh(&mut self, key: &EcKeyRef) -> Result<(), ErrorStack>
[src]
fn current_cipher(&self) -> Option<&SslCipherRef>
[src]
fn state_string(&self) -> &'static str
[src]
fn state_string_long(&self) -> &'static str
[src]
fn set_hostname(&mut self, hostname: &str) -> Result<(), ErrorStack>
[src]
Sets the host name to be used with SNI (Server Name Indication).
fn peer_certificate(&self) -> Option<X509>
[src]
Returns the certificate of the peer, if present.
fn peer_cert_chain(&self) -> Option<&StackRef<X509>>
[src]
Returns the certificate chain of the peer, if present.
On the client side, the chain includes the leaf certificate, but on the server side it does not. Fun!
fn certificate(&self) -> Option<&X509Ref>
[src]
Returns the certificate associated with this Ssl
, if present.
fn private_key(&self) -> Option<&PKeyRef>
[src]
Returns the private key associated with this Ssl
, if present.
fn version(&self) -> &'static str
[src]
Returns the name of the protocol used for the connection, e.g. "TLSv1.2", "SSLv3", etc.
fn selected_npn_protocol(&self) -> Option<&[u8]>
[src]
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.
fn pending(&self) -> usize
[src]
Returns the number of bytes remaining in the currently processed TLS record.
fn compression(&self) -> Option<&str>
[src]
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 servername(&self) -> Option<&str>
[src]
Returns the server's name for the current connection
fn set_ssl_context(&mut self, ctx: &SslContextRef) -> Result<(), ErrorStack>
[src]
Changes the context corresponding to the current connection.
fn ssl_context(&self) -> &SslContextRef
[src]
Returns the context corresponding to the current connection
fn verify_result(&self) -> Option<X509VerifyError>
[src]
Returns the result of X509 certificate verification.
fn session(&self) -> Option<&SslSessionRef>
[src]
Returns the SSL session.
unsafe fn set_session(
&mut self,
session: &SslSessionRef
) -> Result<(), ErrorStack>
[src]
&mut self,
session: &SslSessionRef
) -> Result<(), ErrorStack>
Sets the session to be used.
Safety
The caller of this method is responsible for ensuring that the session is associated
with the same SslContext
as this Ssl
.
fn session_reused(&self) -> bool
[src]
Determines if the session provided to set_session
was successfully reused.
fn set_status_type(&mut self, type_: StatusType) -> Result<(), ErrorStack>
[src]
Sets the status response a client wishes the server to reply with.
fn ocsp_status(&self) -> Option<&[u8]>
[src]
Returns the server's OCSP response, if present.
fn set_ocsp_status(&mut self, response: &[u8]) -> Result<(), ErrorStack>
[src]
Sets the OCSP response to be returned to the client.
fn is_server(&self) -> bool
[src]
Determines if this Ssl
is configured for server-side or client-side use.
fn set_ex_data<T>(&mut self, index: Index<Ssl, T>, data: T)
[src]
Sets the extra data at the specified index.
fn ex_data<T>(&self, index: Index<Ssl, T>) -> Option<&T>
[src]
Returns a reference to the extra data at the specified index.
Trait Implementations
impl ForeignTypeRef for SslRef
type CType = SSL
The raw C type.
unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self
[src]
Constructs a shared instance of this type from its raw type.
unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self
[src]
Constructs a mutable reference of this type from its raw type.
fn as_ptr(&self) -> *mut Self::CType
[src]
Returns a raw pointer to the wrapped value.