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