NAME

ssl - OpenSSL SSL/TLS library

SYNOPSIS

See the individual manual pages for details.

DESCRIPTION

The OpenSSL ssl library implements the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols. It provides a rich API which is documented here.

An SSL_CTX object is created as a framework to establish TLS/SSL enabled connections (see SSL_CTX_new (3)). Various options regarding certificates, algorithms etc. can be set in this object.

When a network connection has been created, it can be assigned to an SSL object. After the SSL object has been created using SSL_new (3), SSL_set_fd (3) or SSL_set_bio (3) can be used to associate the network connection with the object.

When the TLS/SSL handshake is performed using SSL_accept (3) or SSL_connect (3) respectively. SSL_read_ex (3), SSL_read (3), SSL_write_ex (3) and SSL_write (3) are used to read and write data on the TLS/SSL connection. SSL_shutdown (3) can be used to shut down the TLS/SSL connection.

DATA STRUCTURES

Currently the OpenSSL ssl library functions deals with the following data structures:

HEADER FILES

Currently the OpenSSL ssl library provides the following C header files containing the prototypes for the data structures and functions:

API FUNCTIONS

Currently the OpenSSL ssl library exports 214 API functions. They are documented in the following:

Dealing with Protocol Methods

Here we document the various API functions which deal with the SSL/TLS protocol methods defined in SSL_METHOD structures.

Dealing with Ciphers

Here we document the various API functions which deal with the SSL/TLS ciphers defined in SSL_CIPHER structures.

Dealing with Protocol Contexts

Here we document the various API functions which deal with the SSL/TLS protocol context defined in the SSL_CTX structure.

Use the default paths to locate trusted CA certificates. There is one default directory path and one default file path. Both are set via this call.

Dealing with Sessions

Here we document the various API functions which deal with the SSL/TLS sessions defined in the SSL_SESSION structures.

Dealing with Connections

Here we document the various API functions which deal with the SSL/TLS connection defined in the SSL structure.

Sets the session details for t to be the same as in f. Returns 1 on success or 0 on failure.

SSL_dup() allows applications to configure an SSL handle for use in multiple SSL connections, and then duplicate it prior to initiating each connection with the duplicated handle. Use of SSL_dup() avoids the need to repeat the configuration of the handles for each connection. For SSL_dup() to work, the connection MUST be in its initial state and MUST NOT have not yet have started the SSL handshake. For connections that are not in their initial state SSL_dup() just increments an internal reference count and returns the same handle. It may be possible to use SSL_clear (3) to recycle an SSL handle that is not in its initial state for re-use, but this is best avoided. Instead, save and restore the session, if desired, and construct a fresh handle for each connection.

Returns the current handshake state.

RETURN VALUES

See the individual manual pages for details.

SEE ALSO

openssl (1), crypto (7), CRYPTO_get_ex_new_index (3), SSL_accept (3), SSL_clear (3), SSL_connect (3), SSL_CIPHER_get_name (3), SSL_COMP_add_compression_method (3), SSL_CTX_add_extra_chain_cert (3), SSL_CTX_add_session (3), SSL_CTX_ctrl (3), SSL_CTX_flush_sessions (3), SSL_CTX_get_verify_mode (3), SSL_CTX_load_verify_locations (3) SSL_CTX_new (3), SSL_CTX_sess_number (3), SSL_CTX_sess_set_cache_size (3), SSL_CTX_sess_set_get_cb (3), SSL_CTX_sessions (3), SSL_CTX_set_cert_store (3), SSL_CTX_set_cert_verify_callback (3), SSL_CTX_set_cipher_list (3), SSL_CTX_set_client_CA_list (3), SSL_CTX_set_client_cert_cb (3), SSL_CTX_set_default_passwd_cb (3), SSL_CTX_set_generate_session_id (3), SSL_CTX_set_info_callback (3), SSL_CTX_set_max_cert_list (3), SSL_CTX_set_mode (3), SSL_CTX_set_msg_callback (3), SSL_CTX_set_options (3), SSL_CTX_set_quiet_shutdown (3), SSL_CTX_set_read_ahead (3), SSL_CTX_set_security_level (3), SSL_CTX_set_session_cache_mode (3), SSL_CTX_set_session_id_context (3), SSL_CTX_set_ssl_version (3), SSL_CTX_set_timeout (3), SSL_CTX_set_tmp_dh_callback (3), SSL_CTX_set_verify (3), SSL_CTX_use_certificate (3), SSL_alert_type_string (3), SSL_do_handshake (3), SSL_enable_ct (3), SSL_get_SSL_CTX (3), SSL_get_ciphers (3), SSL_get_client_CA_list (3), SSL_get_default_timeout (3), SSL_get_error (3), SSL_get_ex_data_X509_STORE_CTX_idx (3), SSL_get_fd (3), SSL_get_peer_cert_chain (3), SSL_get_rbio (3), SSL_get_session (3), SSL_get_verify_result (3), SSL_get_version (3), SSL_load_client_CA_file (3), SSL_new (3), SSL_pending (3), SSL_read_ex (3), SSL_read (3), SSL_rstate_string (3), SSL_session_reused (3), SSL_set_bio (3), SSL_set_connect_state (3), SSL_set_fd (3), SSL_set_session (3), SSL_set_shutdown (3), SSL_shutdown (3), SSL_state_string (3), SSL_want (3), SSL_write_ex (3), SSL_write (3), SSL_SESSION_free (3), SSL_SESSION_get_time (3), d2i_SSL_SESSION (3), SSL_CTX_set_psk_client_callback (3), SSL_CTX_use_psk_identity_hint (3), SSL_get_psk_identity (3), DTLSv1_listen (3)

HISTORY

SSLv2_client_method, SSLv2_server_method and SSLv2_method were removed in OpenSSL 1.1.0.

The return type of SSL_copy_session_id was changed from void to int in OpenSSL 1.1.0.

COPYRIGHT

Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the OpenSSL license (the License). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.