[−][src]Struct openssl::ssl::SslContext
An SSL context object
Internally ref-counted, use .clone() in the same way as Rc and Arc.
Methods
impl SslContext[src]
impl SslContextpub fn new(method: SslMethod) -> Result<SslContext, SslError>[src]
pub fn new(method: SslMethod) -> Result<SslContext, SslError>Creates a new SSL context.
pub fn set_verify(
&mut self,
mode: SslVerifyMode,
verify: Option<VerifyCallback>
)[src]
pub fn set_verify(
&mut self,
mode: SslVerifyMode,
verify: Option<VerifyCallback>
)Configures the certificate verification method for new connections.
pub fn set_verify_with_data<T>(
&mut self,
mode: SslVerifyMode,
verify: VerifyCallbackData<T>,
data: T
) where
T: Any + 'static, [src]
pub fn set_verify_with_data<T>(
&mut self,
mode: SslVerifyMode,
verify: VerifyCallbackData<T>,
data: T
) where
T: Any + 'static, Configures the certificate verification method for new connections also carrying supplied data.
pub fn set_servername_callback(&mut self, callback: Option<ServerNameCallback>)[src]
pub fn set_servername_callback(&mut self, callback: Option<ServerNameCallback>)Configures the server name indication (SNI) callback for new connections
obtain the server name with get_servername then set the corresponding context
with set_ssl_context
pub fn set_servername_callback_with_data<T>(
&mut self,
callback: ServerNameCallbackData<T>,
data: T
) where
T: Any + 'static, [src]
pub fn set_servername_callback_with_data<T>(
&mut self,
callback: ServerNameCallbackData<T>,
data: T
) where
T: Any + 'static, Configures the server name indication (SNI) callback for new connections carrying supplied data
pub fn set_verify_depth(&mut self, depth: u32)[src]
pub fn set_verify_depth(&mut self, depth: u32)Sets verification depth
pub fn set_read_ahead(&self, m: u32)[src]
pub fn set_read_ahead(&self, m: u32)pub fn set_tmp_dh(&self, dh: DH) -> Result<(), SslError>[src]
pub fn set_tmp_dh(&self, dh: DH) -> Result<(), SslError>pub fn set_default_verify_paths(&mut self) -> Result<(), SslError>[src]
pub fn set_default_verify_paths(&mut self) -> Result<(), SslError>Use the default locations of trusted certificates for verification.
These locations are read from the SSL_CERT_FILE and SSL_CERT_DIR
environment variables if present, or defaults specified at OpenSSL
build time otherwise.
pub fn set_CA_file<P: AsRef<Path>>(&mut self, file: P) -> Result<(), SslError>[src]
pub fn set_CA_file<P: AsRef<Path>>(&mut self, file: P) -> Result<(), SslError>Specifies the file that contains trusted CA certificates.
pub fn set_session_id_context(&mut self, sid_ctx: &[u8]) -> Result<(), SslError>[src]
pub fn set_session_id_context(&mut self, sid_ctx: &[u8]) -> Result<(), SslError>Set the context identifier for sessions
This value identifies the server's session cache to a clients, telling them when they're able to reuse sessions. Should be set to a unique value per server, unless multiple servers share a session cache.
This value should be set when using client certificates, or each request will fail handshake and need to be restarted.
pub fn set_certificate_file<P: AsRef<Path>>(
&mut self,
file: P,
file_type: X509FileType
) -> Result<(), SslError>[src]
pub fn set_certificate_file<P: AsRef<Path>>(
&mut self,
file: P,
file_type: X509FileType
) -> Result<(), SslError>Specifies the file that contains certificate
pub fn set_certificate_chain_file<P: AsRef<Path>>(
&mut self,
file: P,
file_type: X509FileType
) -> Result<(), SslError>[src]
pub fn set_certificate_chain_file<P: AsRef<Path>>(
&mut self,
file: P,
file_type: X509FileType
) -> Result<(), SslError>Specifies the file that contains certificate chain
pub fn set_certificate(&mut self, cert: &X509) -> Result<(), SslError>[src]
pub fn set_certificate(&mut self, cert: &X509) -> Result<(), SslError>Specifies the certificate
pub fn add_extra_chain_cert(&mut self, cert: &X509) -> Result<(), SslError>[src]
pub fn add_extra_chain_cert(&mut self, cert: &X509) -> Result<(), SslError>Adds a certificate to the certificate chain presented together with the certificate specified using set_certificate()
pub fn set_private_key_file<P: AsRef<Path>>(
&mut self,
file: P,
file_type: X509FileType
) -> Result<(), SslError>[src]
pub fn set_private_key_file<P: AsRef<Path>>(
&mut self,
file: P,
file_type: X509FileType
) -> Result<(), SslError>Specifies the file that contains private key
pub fn set_private_key(&mut self, key: &PKey) -> Result<(), SslError>[src]
pub fn set_private_key(&mut self, key: &PKey) -> Result<(), SslError>Specifies the private key
pub fn check_private_key(&mut self) -> Result<(), SslError>[src]
pub fn check_private_key(&mut self) -> Result<(), SslError>Check consistency of private key and certificate
pub fn set_cipher_list(&mut self, cipher_list: &str) -> Result<(), SslError>[src]
pub fn set_cipher_list(&mut self, cipher_list: &str) -> Result<(), SslError>pub fn set_options(&mut self, option: SslContextOptions) -> SslContextOptions[src]
pub fn set_options(&mut self, option: SslContextOptions) -> SslContextOptionspub fn get_options(&mut self) -> SslContextOptions[src]
pub fn get_options(&mut self) -> SslContextOptionspub fn clear_options(&mut self, option: SslContextOptions) -> SslContextOptions[src]
pub fn clear_options(&mut self, option: SslContextOptions) -> SslContextOptionsTrait Implementations
impl<'a> IntoSsl for &'a SslContext[src]
impl<'a> IntoSsl for &'a SslContextimpl Clone for SslContext[src]
impl Clone for SslContextfn clone(&self) -> Self[src]
fn clone(&self) -> SelfReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Drop for SslContext[src]
impl Drop for SslContextimpl Sync for SslContext[src]
impl Sync for SslContextimpl Send for SslContext[src]
impl Send for SslContextimpl Debug for SslContext[src]
impl Debug for SslContextBlanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, type Owned = T
fn to_owned(&self) -> T[src]
fn to_owned(&self) -> TCreates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)[src]
fn clone_into(&self, target: &mut T)🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more