Struct openssl::ssl::SslContextBuilder [] [src]

pub struct SslContextBuilder(_);

A builder for SslContexts.

Methods

impl SslContextBuilder
[src]

Configures the certificate verification method for new connections.

Configures the certificate verification method for new connections and registers a verification callback.

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

Sets verification depth

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.

Specifies the file that contains trusted CA certificates.

Sets the list of CAs sent to the client.

The CA certificates must still be added to the trust root.

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.

Loads a certificate from a file.

Loads a certificate chain from a file.

The file should contain a sequence of PEM-formatted certificates, the first being the leaf certificate, and the remainder forming the chain of certificates up to and including the trusted root certificate.

Sets the certificate.

Appends a certificate to the certificate chain.

This chain should contain all certificates necessary to go from the certificate specified by set_certificate to a trusted root.

Loads the private key from a file.

Sets the private key.

Sets the cipher configuration.

See man 1 ciphers for details on the format.

Set the protocols to be used during Next Protocol Negotiation (the protocols supported by the application).

Checks consistency between the private key and certificate.

Returns a shared reference to the context's certificate store.

Returns a mutable reference to the context's certificate store.

Sets the callback dealing with OCSP stapling.

On the client side, this callback is responsible for validating the OCSP status response returned by the server. The status may be retrieved with the SslRef::ocsp_status method. A response of Ok(true) indicates that the OCSP status is valid, and a response of Ok(false) indicates that the OCSP status is invalid and the handshake should be terminated.

On the server side, this callback is resopnsible for setting the OCSP status response to be returned to clients. The status may be set with the SslRef::set_ocsp_status method. A response of Ok(true) indicates that the OCSP status should be returned to the client, and Ok(false) indicates that the status should not be returned to the client.

Trait Implementations

impl Sync for SslContextBuilder
[src]

impl Send for SslContextBuilder
[src]

impl Drop for SslContextBuilder
[src]

A method called when the value goes out of scope. Read more