c0f598df30de1bf553f1ebd9b2567b7814737ad3
[openssl.git] / doc / ssl / OPENSSL_INIT_ssl_library_start.pod
1 =pod
2
3 =head1 NAME
4
5 OPENSSL_INIT_ssl_library_start - OpenSSL (libssl and libcrypto) initialisation
6
7 =head1 SYNOPSIS
8
9  #include <openssl/ssl.h>
10
11  void OPENSSL_INIT_ssl_library_start(uint64_t opts,
12                                      const OPENSSL_INIT_SETTINGS *settings);
13
14 =head1 DESCRIPTION
15
16 During normal operation OpenSSL (libssl and libcrypto) will allocate various
17 resources at start up that must, subsequently, be freed on close down of the
18 library. Additionally some resources are allocated on a per thread basis (if the
19 application is multi-threaded), and these resources must be freed prior to the
20 thread closing.
21
22 As of version 1.1.0 OpenSSL will automatically allocate all resources that it
23 needs so no explicit initialisation is required. Similarly it will also
24 automatically deinitialise as required.
25
26 However, there way be situations when explicit initialisation is desirable or
27 needed, for example when some non-default initialisation is required. The
28 function OPENSSL_INIT_ssl_library_start() can be used for this purpose. Calling
29 this function will explicitly initialise BOTH libcrypto and libssl. To
30 explicitly initialise ONLY libcrypto see the
31 L<OPENSSL_INIT_crypto_library_start(3)> function.
32
33 Numerous internal OpenSSL functions call OPENSSL_INIT_ssl_library_start().
34 Therefore, in order to perform non-default initialisation,
35 OPENSSL_INIT_ssl_library_start() MUST be called by application code prior to
36 any other OpenSSL function calls.
37
38 The B<opts> parameter specifies which aspects of libssl and libcrypto should be
39 initialised. Valid options for libcrypto are described on the
40 L<OPENSSL_INIT_crypto_library_start(3)> page. In addition to any libcrypto
41 specific option the following libssl options can also be used:
42
43 =over 4
44
45 =item OPENSSL_INIT_NO_LOAD_SSL_STRINGS
46
47 Suppress automatic loading of the libssl error strings. With this option the
48 library will not automatically call ERR_load_SSL_strings(). This option is
49 not a default option. Once selected subsequent calls to
50 OPENSSL_INIT_ssl_library_start() with the option
51 B<OPENSSL_INIT_LOAD_SSL_STRINGS> will be ignored. Applications may call
52 ERR_load_SSL_strings() directly if they wish even if this option has been
53 selected. If they do so then they must also explicitly call ERR_free_strings()
54 on application close down.
55
56 =item OPENSSL_INIT_LOAD_SSL_STRINGS
57
58 Automatic loading of the libssl error strings. With this option the
59 library will automatically call ERR_load_SSL_strings(). This option is a
60 default option. Once selected subsequent calls to
61 OPENSSL_INIT_ssl_library_start() with the option
62 B<OPENSSL_INIT_LOAD_SSL_STRINGS> will be ignored.
63
64 =back
65
66 The B<settings> parameter specifies optional settings values to an option.
67 Currently no such settings are available for libssl specific options. However
68 these settings will also be passed internally to a call to
69 L<OPENSSL_INIT_crypto_library_start(3)>, so this parameter can also be used to
70 provide libcrypto settings values.
71
72 =head1 SEE ALSO
73
74 L<OPENSSL_INIT_crypto_library_start(3)>
75
76 =head1 HISTORY
77
78 The OPENSSL_INIT_ssl_library_start function was added in OpenSSL 1.1.0.
79
80 =cut