xref: /openbsd-src/lib/libcrypto/man/OPENSSL_config.3 (revision 232cea1ab05f9fdf899e5d7039624a2378524897)
1*232cea1aStb.\" $OpenBSD: OPENSSL_config.3,v 1.16 2023/11/19 21:01:27 tb Exp $
2f0b59fb4Sschwarze.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
38974101aSjmc.\"
4f0b59fb4Sschwarze.\" This file is a derived work.
5f0b59fb4Sschwarze.\" The changes are covered by the following Copyright and license:
6f0b59fb4Sschwarze.\"
7f0b59fb4Sschwarze.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
8f0b59fb4Sschwarze.\"
9f0b59fb4Sschwarze.\" Permission to use, copy, modify, and distribute this software for any
10f0b59fb4Sschwarze.\" purpose with or without fee is hereby granted, provided that the above
11f0b59fb4Sschwarze.\" copyright notice and this permission notice appear in all copies.
12f0b59fb4Sschwarze.\"
13f0b59fb4Sschwarze.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14f0b59fb4Sschwarze.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15f0b59fb4Sschwarze.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16f0b59fb4Sschwarze.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17f0b59fb4Sschwarze.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18f0b59fb4Sschwarze.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19f0b59fb4Sschwarze.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20f0b59fb4Sschwarze.\"
21f0b59fb4Sschwarze.\" The original file was written by Dr. Stephen Henson <steve@openssl.org>.
22f0b59fb4Sschwarze.\" Copyright (c) 2004 The OpenSSL Project.  All rights reserved.
23c2a178dfSschwarze.\"
24c2a178dfSschwarze.\" Redistribution and use in source and binary forms, with or without
25c2a178dfSschwarze.\" modification, are permitted provided that the following conditions
26c2a178dfSschwarze.\" are met:
27c2a178dfSschwarze.\"
28c2a178dfSschwarze.\" 1. Redistributions of source code must retain the above copyright
29c2a178dfSschwarze.\"    notice, this list of conditions and the following disclaimer.
30c2a178dfSschwarze.\"
31c2a178dfSschwarze.\" 2. Redistributions in binary form must reproduce the above copyright
32c2a178dfSschwarze.\"    notice, this list of conditions and the following disclaimer in
33c2a178dfSschwarze.\"    the documentation and/or other materials provided with the
34c2a178dfSschwarze.\"    distribution.
35c2a178dfSschwarze.\"
36c2a178dfSschwarze.\" 3. All advertising materials mentioning features or use of this
37c2a178dfSschwarze.\"    software must display the following acknowledgment:
38c2a178dfSschwarze.\"    "This product includes software developed by the OpenSSL Project
39c2a178dfSschwarze.\"    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
40c2a178dfSschwarze.\"
41c2a178dfSschwarze.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
42c2a178dfSschwarze.\"    endorse or promote products derived from this software without
43c2a178dfSschwarze.\"    prior written permission. For written permission, please contact
44c2a178dfSschwarze.\"    openssl-core@openssl.org.
45c2a178dfSschwarze.\"
46c2a178dfSschwarze.\" 5. Products derived from this software may not be called "OpenSSL"
47c2a178dfSschwarze.\"    nor may "OpenSSL" appear in their names without prior written
48c2a178dfSschwarze.\"    permission of the OpenSSL Project.
49c2a178dfSschwarze.\"
50c2a178dfSschwarze.\" 6. Redistributions of any form whatsoever must retain the following
51c2a178dfSschwarze.\"    acknowledgment:
52c2a178dfSschwarze.\"    "This product includes software developed by the OpenSSL Project
53c2a178dfSschwarze.\"    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
54c2a178dfSschwarze.\"
55c2a178dfSschwarze.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
56c2a178dfSschwarze.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57c2a178dfSschwarze.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
58c2a178dfSschwarze.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
59c2a178dfSschwarze.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
60c2a178dfSschwarze.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
61c2a178dfSschwarze.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
62c2a178dfSschwarze.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
63c2a178dfSschwarze.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
64c2a178dfSschwarze.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65c2a178dfSschwarze.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66c2a178dfSschwarze.\" OF THE POSSIBILITY OF SUCH DAMAGE.
67c2a178dfSschwarze.\"
68*232cea1aStb.Dd $Mdocdate: November 19 2023 $
69d18d1815Sschwarze.Dt OPENSSL_CONFIG 3
70d18d1815Sschwarze.Os
71d18d1815Sschwarze.Sh NAME
72d18d1815Sschwarze.Nm OPENSSL_config ,
73d18d1815Sschwarze.Nm OPENSSL_no_config
7441d72ce5Sschwarze.Nd simple crypto and ssl library configuration
75d18d1815Sschwarze.Sh SYNOPSIS
76d18d1815Sschwarze.In openssl/conf.h
77d18d1815Sschwarze.Ft void
78d18d1815Sschwarze.Fo OPENSSL_config
79f0b59fb4Sschwarze.Fa "const char *appname"
80d18d1815Sschwarze.Fc
81d18d1815Sschwarze.Ft void
82d18d1815Sschwarze.Fn OPENSSL_no_config void
83d18d1815Sschwarze.Sh DESCRIPTION
84d18d1815Sschwarze.Fn OPENSSL_config
85536f31e8Sschwarzeinitializes the crypto library and calls
86f0b59fb4Sschwarze.Xr CONF_modules_load_file 3
87f0b59fb4Sschwarzewith the standard configuration file and the given
88f0b59fb4Sschwarze.Fa appname .
89d18d1815SschwarzeIf
90f0b59fb4Sschwarze.Fa appname
91d18d1815Sschwarzeis
92f0b59fb4Sschwarze.Dv NULL ,
93d18d1815Sschwarzethen the default name
94d18d1815Sschwarze.Sy openssl_conf
95f0b59fb4Sschwarzeis used.
96d18d1815SschwarzeAny errors are ignored.
97d18d1815SschwarzeFurther calls to
98d18d1815Sschwarze.Fn OPENSSL_config
99f0b59fb4Sschwarzehave no effect.
100d18d1815Sschwarze.Pp
101d18d1815Sschwarze.Fn OPENSSL_no_config
102536f31e8Sschwarzesuppresses the loading of the standard configuration file, so that any
103afdb179aSbeckfuture calls to
10441d72ce5Sschwarze.Fn OPENSSL_config
105afdb179aSbeckor to
106afdb179aSbeck.Xr OPENSSL_init_crypto 3
107cedd3326Sjmcwill ensure the library is initialized but no configuration
108afdb179aSbeckfile will be loaded.
10941d72ce5Sschwarze.Pp
11041d72ce5SschwarzeCalling these functions is optional.
11141d72ce5SschwarzeAll required initialization of the crypto libraries happens
11241d72ce5Sschwarzeautomatically when needed.
113d18d1815Sschwarze.Pp
114536f31e8SschwarzeTo use a non-standard configuration file, refer to
115536f31e8Sschwarze.Xr CONF_modules_load_file 3 .
116536f31e8Sschwarze.Pp
117536f31e8SschwarzeInternally,
118536f31e8Sschwarze.Fn OPENSSL_config
119536f31e8Sschwarzecalls
120*232cea1aStb.Xr OPENSSL_init_crypto 3
121536f31e8Sschwarzeand
122*232cea1aStb.Xr OPENSSL_load_builtin_modules 3 .
123536f31e8Sschwarze.Pp
124f0b59fb4SschwarzeIf an application is compiled with the preprocessor symbol
125d18d1815Sschwarze.Dv OPENSSL_LOAD_CONF
126f0b59fb4Sschwarze#define'd,
127f0b59fb4Sschwarze.Xr OpenSSL_add_all_algorithms 3
128f0b59fb4Sschwarzeautomatically calls
129f0b59fb4Sschwarze.Fn OPENSSL_config .
130d18d1815Sschwarze.Pp
131d18d1815SschwarzeApplications should free up configuration at application closedown by
132d18d1815Sschwarzecalling
133d18d1815Sschwarze.Xr CONF_modules_free 3 .
134a8f29161Sschwarze.Sh FILES
135a8f29161Sschwarze.Bl -tag -width /etc/ssl/openssl.cnf -compact
136a8f29161Sschwarze.It Pa /etc/ssl/openssl.cnf
137a8f29161Sschwarzestandard configuration file
138a8f29161Sschwarze.El
139d18d1815Sschwarze.Sh SEE ALSO
140d18d1815Sschwarze.Xr CONF_modules_free 3 ,
141f0b59fb4Sschwarze.Xr CONF_modules_load_file 3 ,
14200d4e240Sschwarze.Xr crypto 3 ,
14341d72ce5Sschwarze.Xr OPENSSL_load_builtin_modules 3 ,
144c4c55c71Sschwarze.Xr OPENSSL_VERSION_NUMBER 3 ,
145c4c55c71Sschwarze.Xr openssl.cnf 5 ,
146c4c55c71Sschwarze.Xr x509v3.cnf 5
147d18d1815Sschwarze.Sh HISTORY
148d18d1815Sschwarze.Fn OPENSSL_config
149d18d1815Sschwarzeand
150d18d1815Sschwarze.Fn OPENSSL_no_config
15180d1afcdSschwarzefirst appeared in OpenSSL 0.9.7 and have been available since
15280d1afcdSschwarze.Ox 3.2 .
153