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