
#use wml::openssl-macros area=docs page=OPENSSL_config

<title>Documents, OPENSSL_config(3)</title>

<h1>OPENSSL_config(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#NOTES">NOTES</A>
	<LI><A HREF="#RESTRICTIONS">RESTRICTIONS</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#HISTORY">HISTORY</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
OPENSSL_config, OPENSSL_no_config - simple OpenSSL configuration functions

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/conf.h&gt;
</PRE>
<PRE> void OPENSSL_config(const char *config_name);
 void OPENSSL_no_config(void);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
<CODE>OPENSSL_config()</CODE> configures OpenSSL using the standard <STRONG>openssl.cnf</STRONG>
configuration file name using <STRONG>config_name</STRONG>. If <STRONG>config_name</STRONG> is NULL then the default name <STRONG>openssl_conf</STRONG> will be used. Any errors are ignored. Further calls to
<CODE>OPENSSL_config()</CODE> will have no effect. The configuration file
format is documented in the <EM>conf(5)</EM> manual page.

</P>
<P>
<CODE>OPENSSL_no_config()</CODE> disables configuration. If called before
<CODE>OPENSSL_config()</CODE> no configuration takes place.

</P>
<P>
<HR>
<H1><A NAME="NOTES">NOTES</A></H1>
<P>
It is <STRONG>strongly</STRONG> recommended that <STRONG>all</STRONG> new applications call <CODE>OPENSSL_config()</CODE> or the more
sophisticated functions such as <CODE>CONF_modules_load()</CODE> during
initialization (that is before starting any threads). By doing this an
application does not need to keep track of all configuration options and
some new functionality can be supported automatically.

</P>
<P>
It is also possible to automatically call <CODE>OPENSSL_config()</CODE>
when an application calls <CODE>OPENSSL_add_all_algorithms()</CODE> by
compiling an application with the preprocessor symbol <STRONG>OPENSSL_LOAD_CONF</STRONG> #define'd. In this way configuration can be added without source changes.

</P>
<P>
The environment variable <STRONG>OPENSSL_CONF</STRONG> can be set to specify the location of the configuration file. Currently
ASN1 OBJECTs and ENGINE configuration can be performed future versions of
OpenSSL will add new configuration options.

</P>
<P>
There are several reasons why calling the OpenSSL configuration routines is
advisable. For example new ENGINE functionality was added to OpenSSL 0.9.7.
In OpenSSL 0.9.7 control functions can be supported by ENGINEs, this can be
used (among other things) to load dynamic ENGINEs from shared libraries
(DSOs). However very few applications currently support the control
interface and so very few can load and use dynamic ENGINEs. Equally in
future more sophisticated ENGINEs will require certain control operations
to customize them. If an application calls <CODE>OPENSSL_config()</CODE> it
doesn't need to know or care about ENGINE control operations because they
can be performed by editing a configuration file.

</P>
<P>
Applications should free up configuration at application closedown by
calling <CODE>CONF_modules_free().</CODE>

</P>
<P>
<HR>
<H1><A NAME="RESTRICTIONS">RESTRICTIONS</A></H1>
<P>
The <CODE>OPENSSL_config()</CODE> function is designed to be a very simple
``call it and forget it'' function. As a result its behaviour is somewhat
limited. It ignores all errors silently and it can only load from the
standard configuration file location for example.

</P>
<P>
It is however <STRONG>much</STRONG> better than nothing. Applications which need finer control over their
configuration functionality should use the configuration functions such as
<CODE>CONF_load_modules()</CODE> directly.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
Neither <CODE>OPENSSL_config()</CODE> nor <CODE>OPENSSL_no_config()</CODE>
return a value.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<EM>conf(5)</EM>, <EM>CONF_load_modules_file(3)</EM>,
<EM>CONF_modules_free(3),CONF_modules_free(3)</EM>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
<CODE>OPENSSL_config()</CODE> and <CODE>OPENSSL_no_config()</CODE> first
appeared in OpenSSL 0.9.7

</P>
:}


