xref: /onnv-gate/usr/src/common/openssl/doc/crypto/OPENSSL_config.pod (revision 2175:b0b2f052a486)
1*2175Sjp161948=pod
2*2175Sjp161948
3*2175Sjp161948=head1 NAME
4*2175Sjp161948
5*2175Sjp161948OPENSSL_config, OPENSSL_no_config - simple OpenSSL configuration functions
6*2175Sjp161948
7*2175Sjp161948=head1 SYNOPSIS
8*2175Sjp161948
9*2175Sjp161948 #include <openssl/conf.h>
10*2175Sjp161948
11*2175Sjp161948 void OPENSSL_config(const char *config_name);
12*2175Sjp161948 void OPENSSL_no_config(void);
13*2175Sjp161948
14*2175Sjp161948=head1 DESCRIPTION
15*2175Sjp161948
16*2175Sjp161948OPENSSL_config() configures OpenSSL using the standard B<openssl.cnf>
17*2175Sjp161948configuration file name using B<config_name>. If B<config_name> is NULL then
18*2175Sjp161948the default name B<openssl_conf> will be used. Any errors are ignored. Further
19*2175Sjp161948calls to OPENSSL_config() will have no effect. The configuration file format
20*2175Sjp161948is documented in the L<conf(5)|conf(5)> manual page.
21*2175Sjp161948
22*2175Sjp161948OPENSSL_no_config() disables configuration. If called before OPENSSL_config()
23*2175Sjp161948no configuration takes place.
24*2175Sjp161948
25*2175Sjp161948=head1 NOTES
26*2175Sjp161948
27*2175Sjp161948It is B<strongly> recommended that B<all> new applications call OPENSSL_config()
28*2175Sjp161948or the more sophisticated functions such as CONF_modules_load() during
29*2175Sjp161948initialization (that is before starting any threads). By doing this
30*2175Sjp161948an application does not need to keep track of all configuration options
31*2175Sjp161948and some new functionality can be supported automatically.
32*2175Sjp161948
33*2175Sjp161948It is also possible to automatically call OPENSSL_config() when an application
34*2175Sjp161948calls OPENSSL_add_all_algorithms() by compiling an application with the
35*2175Sjp161948preprocessor symbol B<OPENSSL_LOAD_CONF> #define'd. In this way configuration
36*2175Sjp161948can be added without source changes.
37*2175Sjp161948
38*2175Sjp161948The environment variable B<OPENSSL_CONF> can be set to specify the location
39*2175Sjp161948of the configuration file.
40*2175Sjp161948
41*2175Sjp161948Currently ASN1 OBJECTs and ENGINE configuration can be performed future
42*2175Sjp161948versions of OpenSSL will add new configuration options.
43*2175Sjp161948
44*2175Sjp161948There are several reasons why calling the OpenSSL configuration routines is
45*2175Sjp161948advisable. For example new ENGINE functionality was added to OpenSSL 0.9.7.
46*2175Sjp161948In OpenSSL 0.9.7 control functions can be supported by ENGINEs, this can be
47*2175Sjp161948used (among other things) to load dynamic ENGINEs from shared libraries (DSOs).
48*2175Sjp161948However very few applications currently support the control interface and so
49*2175Sjp161948very few can load and use dynamic ENGINEs. Equally in future more sophisticated
50*2175Sjp161948ENGINEs will require certain control operations to customize them. If an
51*2175Sjp161948application calls OPENSSL_config() it doesn't need to know or care about
52*2175Sjp161948ENGINE control operations because they can be performed by editing a
53*2175Sjp161948configuration file.
54*2175Sjp161948
55*2175Sjp161948Applications should free up configuration at application closedown by calling
56*2175Sjp161948CONF_modules_free().
57*2175Sjp161948
58*2175Sjp161948=head1 RESTRICTIONS
59*2175Sjp161948
60*2175Sjp161948The OPENSSL_config() function is designed to be a very simple "call it and
61*2175Sjp161948forget it" function. As a result its behaviour is somewhat limited. It ignores
62*2175Sjp161948all errors silently and it can only load from the standard configuration file
63*2175Sjp161948location for example.
64*2175Sjp161948
65*2175Sjp161948It is however B<much> better than nothing. Applications which need finer
66*2175Sjp161948control over their configuration functionality should use the configuration
67*2175Sjp161948functions such as CONF_load_modules() directly.
68*2175Sjp161948
69*2175Sjp161948=head1 RETURN VALUES
70*2175Sjp161948
71*2175Sjp161948Neither OPENSSL_config() nor OPENSSL_no_config() return a value.
72*2175Sjp161948
73*2175Sjp161948=head1 SEE ALSO
74*2175Sjp161948
75*2175Sjp161948L<conf(5)|conf(5)>, L<CONF_load_modules_file(3)|CONF_load_modules_file(3)>,
76*2175Sjp161948L<CONF_modules_free(3),CONF_modules_free(3)>
77*2175Sjp161948
78*2175Sjp161948=head1 HISTORY
79*2175Sjp161948
80*2175Sjp161948OPENSSL_config() and OPENSSL_no_config() first appeared in OpenSSL 0.9.7
81*2175Sjp161948
82*2175Sjp161948=cut
83