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