Struct openssl::ssl::SslContextBuilder
[−]
[src]
pub struct SslContextBuilder(_);
A builder for SslContext
s.
Methods
impl SslContextBuilder
[src]
fn new(method: SslMethod) -> Result<SslContextBuilder, ErrorStack>
unsafe fn from_ptr(ctx: *mut SSL_CTX) -> SslContextBuilder
fn as_ptr(&self) -> *mut SSL_CTX
fn set_verify(&mut self, mode: SslVerifyMode)
Configures the certificate verification method for new connections.
fn set_verify_callback<F>(&mut self, mode: SslVerifyMode, verify: F) where F: Fn(bool, &X509StoreContextRef) -> bool + Any + 'static + Sync + Send
Configures the certificate verification method for new connections and registers a verification callback.
fn set_servername_callback<F>(&mut self, callback: F) where F: Fn(&mut SslRef) -> Result<(), SniError> + Any + 'static + Sync + Send
Configures the server name indication (SNI) callback for new connections
Obtain the server name with servername
then set the corresponding context
with set_ssl_context
fn set_verify_depth(&mut self, depth: u32)
Sets verification depth
fn set_read_ahead(&mut self, read_ahead: bool)
fn set_mode(&mut self, mode: SslMode) -> SslMode
fn set_tmp_dh(&mut self, dh: &DhRef) -> Result<(), ErrorStack>
fn set_tmp_dh_callback<F>(&mut self, callback: F) where F: Fn(&mut SslRef, bool, u32) -> Result<Dh, ErrorStack> + Any + 'static + Sync + Send
fn set_tmp_ecdh(&mut self, key: &EcKeyRef) -> Result<(), ErrorStack>
fn set_default_verify_paths(&mut self) -> Result<(), ErrorStack>
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.
fn set_ca_file<P: AsRef<Path>>(&mut self, file: P) -> Result<(), ErrorStack>
Specifies the file that contains trusted CA certificates.
fn set_client_ca_list(&mut self, list: Stack<X509Name>)
Sets the list of CAs sent to the client.
The CA certificates must still be added to the trust root.
fn set_session_id_context(&mut self, sid_ctx: &[u8]) -> Result<(), ErrorStack>
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.
fn set_certificate_file<P: AsRef<Path>>(&mut self,
file: P,
file_type: X509FileType)
-> Result<(), ErrorStack>
file: P,
file_type: X509FileType)
-> Result<(), ErrorStack>
Specifies the file that contains certificate
fn set_certificate_chain_file<P: AsRef<Path>>(&mut self,
file: P)
-> Result<(), ErrorStack>
file: P)
-> Result<(), ErrorStack>
Specifies the file that contains certificate chain
fn set_certificate(&mut self, cert: &X509Ref) -> Result<(), ErrorStack>
Specifies the certificate
fn add_extra_chain_cert(&mut self, cert: X509) -> Result<(), ErrorStack>
Adds a certificate to the certificate chain presented together with the certificate specified using set_certificate()
fn set_private_key_file<P: AsRef<Path>>(&mut self,
file: P,
file_type: X509FileType)
-> Result<(), ErrorStack>
file: P,
file_type: X509FileType)
-> Result<(), ErrorStack>
Specifies the file that contains private key
fn set_private_key(&mut self, key: &PKeyRef) -> Result<(), ErrorStack>
Specifies the private key
fn set_cipher_list(&mut self, cipher_list: &str) -> Result<(), ErrorStack>
fn set_options(&mut self, option: SslOption) -> SslOption
fn options(&self) -> SslOption
fn clear_options(&mut self, option: SslOption) -> SslOption
fn set_npn_protocols(&mut self, protocols: &[&[u8]]) -> Result<(), ErrorStack>
Set the protocols to be used during Next Protocol Negotiation (the protocols supported by the application).
fn check_private_key(&self) -> Result<(), ErrorStack>
Checks consistency between the private key and certificate.
fn cert_store(&self) -> &X509StoreBuilderRef
Returns a shared reference to the context's certificate store.
fn cert_store_mut(&mut self) -> &mut X509StoreBuilderRef
Returns a mutable reference to the context's certificate store.