1e71b7053SJung-uk Kim=pod 2e71b7053SJung-uk Kim 3e71b7053SJung-uk Kim=head1 NAME 4e71b7053SJung-uk Kim 5e71b7053SJung-uk KimOPENSSL_init_ssl - OpenSSL (libssl and libcrypto) initialisation 6e71b7053SJung-uk Kim 7e71b7053SJung-uk Kim=head1 SYNOPSIS 8e71b7053SJung-uk Kim 9e71b7053SJung-uk Kim #include <openssl/ssl.h> 10e71b7053SJung-uk Kim 11e71b7053SJung-uk Kim int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings); 12e71b7053SJung-uk Kim 13e71b7053SJung-uk Kim=head1 DESCRIPTION 14e71b7053SJung-uk Kim 15e71b7053SJung-uk KimDuring normal operation OpenSSL (libssl and libcrypto) will allocate various 16e71b7053SJung-uk Kimresources at start up that must, subsequently, be freed on close down of the 17e71b7053SJung-uk Kimlibrary. Additionally some resources are allocated on a per thread basis (if the 18e71b7053SJung-uk Kimapplication is multi-threaded), and these resources must be freed prior to the 19e71b7053SJung-uk Kimthread closing. 20e71b7053SJung-uk Kim 21e71b7053SJung-uk KimAs of version 1.1.0 OpenSSL will automatically allocate all resources that it 22e71b7053SJung-uk Kimneeds so no explicit initialisation is required. Similarly it will also 23e71b7053SJung-uk Kimautomatically deinitialise as required. 24e71b7053SJung-uk Kim 25e71b7053SJung-uk KimHowever, there may be situations when explicit initialisation is desirable or 2658f35182SJung-uk Kimneeded, for example when some nondefault initialisation is required. The 27e71b7053SJung-uk Kimfunction OPENSSL_init_ssl() can be used for this purpose. Calling 28e71b7053SJung-uk Kimthis function will explicitly initialise BOTH libcrypto and libssl. To 29e71b7053SJung-uk Kimexplicitly initialise ONLY libcrypto see the 30e71b7053SJung-uk KimL<OPENSSL_init_crypto(3)> function. 31e71b7053SJung-uk Kim 32e71b7053SJung-uk KimNumerous internal OpenSSL functions call OPENSSL_init_ssl(). 3358f35182SJung-uk KimTherefore, in order to perform nondefault initialisation, 34e71b7053SJung-uk KimOPENSSL_init_ssl() MUST be called by application code prior to 35e71b7053SJung-uk Kimany other OpenSSL function calls. 36e71b7053SJung-uk Kim 37e71b7053SJung-uk KimThe B<opts> parameter specifies which aspects of libssl and libcrypto should be 38e71b7053SJung-uk Kiminitialised. Valid options for libcrypto are described on the 39e71b7053SJung-uk KimL<OPENSSL_init_crypto(3)> page. In addition to any libcrypto 40e71b7053SJung-uk Kimspecific option the following libssl options can also be used: 41e71b7053SJung-uk Kim 42e71b7053SJung-uk Kim=over 4 43e71b7053SJung-uk Kim 44e71b7053SJung-uk Kim=item OPENSSL_INIT_NO_LOAD_SSL_STRINGS 45e71b7053SJung-uk Kim 46e71b7053SJung-uk KimSuppress automatic loading of the libssl error strings. This option is 47e71b7053SJung-uk Kimnot a default option. Once selected subsequent calls to 48e71b7053SJung-uk KimOPENSSL_init_ssl() with the option 49e71b7053SJung-uk KimB<OPENSSL_INIT_LOAD_SSL_STRINGS> will be ignored. 50e71b7053SJung-uk Kim 51e71b7053SJung-uk Kim=item OPENSSL_INIT_LOAD_SSL_STRINGS 52e71b7053SJung-uk Kim 53e71b7053SJung-uk KimAutomatic loading of the libssl error strings. This option is a 54e71b7053SJung-uk Kimdefault option. Once selected subsequent calls to 55e71b7053SJung-uk KimOPENSSL_init_ssl() with the option 56e71b7053SJung-uk KimB<OPENSSL_INIT_LOAD_SSL_STRINGS> will be ignored. 57e71b7053SJung-uk Kim 58e71b7053SJung-uk Kim=back 59e71b7053SJung-uk Kim 60e71b7053SJung-uk KimOPENSSL_init_ssl() takes a B<settings> parameter which can be used to 61e71b7053SJung-uk Kimset parameter values. See L<OPENSSL_init_crypto(3)> for details. 62e71b7053SJung-uk Kim 63e71b7053SJung-uk Kim=head1 RETURN VALUES 64e71b7053SJung-uk Kim 65e71b7053SJung-uk KimThe function OPENSSL_init_ssl() returns 1 on success or 0 on error. 66e71b7053SJung-uk Kim 67e71b7053SJung-uk Kim=head1 SEE ALSO 68e71b7053SJung-uk Kim 69e71b7053SJung-uk KimL<OPENSSL_init_crypto(3)> 70e71b7053SJung-uk Kim 71e71b7053SJung-uk Kim=head1 HISTORY 72e71b7053SJung-uk Kim 73e71b7053SJung-uk KimThe OPENSSL_init_ssl() function was added in OpenSSL 1.1.0. 74e71b7053SJung-uk Kim 75e71b7053SJung-uk Kim=head1 COPYRIGHT 76e71b7053SJung-uk Kim 7758f35182SJung-uk KimCopyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. 78e71b7053SJung-uk Kim 79*b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 80e71b7053SJung-uk Kimthis file except in compliance with the License. You can obtain a copy 81e71b7053SJung-uk Kimin the file LICENSE in the source distribution or at 82e71b7053SJung-uk KimL<https://www.openssl.org/source/license.html>. 83e71b7053SJung-uk Kim 84e71b7053SJung-uk Kim=cut 85