1 .\" $NetBSD: openssl.cnf.5,v 1.14 2015/06/12 17:01:14 christos Exp $
3 .\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
6 .\" ========================================================================
7 .de Sp \" Vertical space (when we can't use .PP)
11 .de Vb \" Begin verbatim text
16 .de Ve \" End verbatim text
20 .\" Set up some character translations and predefined strings. \*(-- will
21 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
22 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
23 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
24 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
25 .\" nothing in troff, for use with C<>.
27 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
31 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
32 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
47 .\" Escape single quotes in literal strings from groff's Unicode transform.
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
53 .\" entries marked with X<> in POD. Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
56 .\" Avoid warning from groff about undefined register 'F'.
60 .if \n(.g .if rF .nr rF 1
61 .if (\n(rF:(\n(.g==0)) \{
64 . tm Index:\\$1\t\\n%\t"\\$2"
74 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
75 .\" Fear. Run. Save yourself. No user-serviceable parts.
76 . \" fudge factors for nroff and troff
85 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
91 . \" simple accents for nroff and troff
101 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
102 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
103 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
104 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
105 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
106 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
108 . \" troff and (daisy-wheel) nroff accents
109 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
110 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
111 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
112 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
113 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
114 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
115 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
116 .ds ae a\h'-(\w'a'u*4/10)'e
117 .ds Ae A\h'-(\w'A'u*4/10)'E
118 . \" corrections for vroff
119 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
120 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
121 . \" for low resolution devices (crt and lpr)
122 .if \n(.H>23 .if \n(.V>19 \
135 .\" ========================================================================
138 .TH CONFIG 5 "2015-06-12" "1.0.1n" "OpenSSL"
139 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
140 .\" way too many mistakes in technical documents.
144 config \- OpenSSL CONF library configuration files
146 .IX Header "DESCRIPTION"
147 The OpenSSL \s-1CONF\s0 library can be used to read configuration files.
148 It is used for the OpenSSL master configuration file \fBopenssl.cnf\fR
149 and in a few other places like \fB\s-1SPKAC\s0\fR files and certificate extension
150 files for the \fBx509\fR utility. OpenSSL applications can also use the
151 \&\s-1CONF\s0 library for their own purposes.
153 A configuration file is divided into a number of sections. Each section
154 starts with a line \fB[ section_name ]\fR and ends when a new section is
155 started or end of file is reached. A section name can consist of
156 alphanumeric characters and underscores.
158 The first section of a configuration file is special and is referred
159 to as the \fBdefault\fR section this is usually unnamed and is from the
160 start of file until the first named section. When a name is being looked up
161 it is first looked up in a named section (if any) and then the
164 The environment is mapped onto a section called \fB\s-1ENV\s0\fR.
166 Comments can be included by preceding them with the \fB#\fR character
168 Each section in a configuration file consists of a number of name and
169 value pairs of the form \fBname=value\fR
171 The \fBname\fR string can contain any alphanumeric characters as well as
172 a few punctuation symbols such as \fB.\fR \fB,\fR \fB;\fR and \fB_\fR.
174 The \fBvalue\fR string consists of the string following the \fB=\fR character
175 until end of line with any leading and trailing white space removed.
177 The value string undergoes variable expansion. This can be done by
178 including the form \fB\f(CB$var\fB\fR or \fB${var}\fR: this will substitute the value
179 of the named variable in the current section. It is also possible to
180 substitute a value from another section using the syntax \fB\f(CB$section::name\fB\fR
181 or \fB${section::name}\fR. By using the form \fB\f(CB$ENV::name\fB\fR environment
182 variables can be substituted. It is also possible to assign values to
183 environment variables by using the name \fBENV::name\fR, this will work
184 if the program looks up environment variables using the \fB\s-1CONF\s0\fR library
185 instead of calling \fB\f(BIgetenv()\fB\fR directly.
187 It is possible to escape certain characters by using any kind of quote
188 or the \fB\e\fR character. By making the last character of a line a \fB\e\fR
189 a \fBvalue\fR string can be spread across multiple lines. In addition
190 the sequences \fB\en\fR, \fB\er\fR, \fB\eb\fR and \fB\et\fR are recognized.
191 .SH "OPENSSL LIBRARY CONFIGURATION"
192 .IX Header "OPENSSL LIBRARY CONFIGURATION"
193 In OpenSSL 0.9.7 and later applications can automatically configure certain
194 aspects of OpenSSL using the master OpenSSL configuration file, or optionally
195 an alternative configuration file. The \fBopenssl\fR utility includes this
196 functionality: any sub command uses the master OpenSSL configuration file
197 unless an option is used in the sub command to use an alternative configuration
200 To enable library configuration the default section needs to contain an
201 appropriate line which points to the main configuration section. The default
202 name is \fBopenssl_conf\fR which is used by the \fBopenssl\fR utility. Other
203 applications may use an alternative name such as \fBmyapplicaton_conf\fR.
205 The configuration section should consist of a set of name value pairs which
206 contain specific module configuration information. The \fBname\fR represents
207 the name of the \fIconfiguration module\fR the meaning of the \fBvalue\fR is
208 module specific: it may, for example, represent a further configuration
209 section containing configuration module specific information. E.g.
212 \& openssl_conf = openssl_init
216 \& oid_section = new_oids
217 \& engines = engine_section
221 \& ... new oids here ...
225 \& ... engine stuff here ...
228 The features of each configuration module are described below.
229 .SS "\s-1ASN1 OBJECT CONFIGURATION MODULE\s0"
230 .IX Subsection "ASN1 OBJECT CONFIGURATION MODULE"
231 This module has the name \fBoid_section\fR. The value of this variable points
232 to a section containing name value pairs of OIDs: the name is the \s-1OID\s0 short
233 and long name, the value is the numerical form of the \s-1OID.\s0 Although some of
234 the \fBopenssl\fR utility sub commands already have their own \s-1ASN1 OBJECT\s0 section
235 functionality not all do. By using the \s-1ASN1 OBJECT\s0 configuration module
236 \&\fBall\fR the \fBopenssl\fR utility sub commands can see the new objects as well
237 as any compliant applications. For example:
242 \& some_new_oid = 1.2.3.4
243 \& some_other_oid = 1.2.3.5
246 In OpenSSL 0.9.8 it is also possible to set the value to the long name followed
247 by a comma and the numerical \s-1OID\s0 form. For example:
250 \& shortName = some object long name, 1.2.3.4
252 .SS "\s-1ENGINE CONFIGURATION MODULE\s0"
253 .IX Subsection "ENGINE CONFIGURATION MODULE"
254 This \s-1ENGINE\s0 configuration module has the name \fBengines\fR. The value of this
255 variable points to a section containing further \s-1ENGINE\s0 configuration
258 The section pointed to by \fBengines\fR is a table of engine names (though see
259 \&\fBengine_id\fR below) and further sections containing configuration information
260 specific to each \s-1ENGINE.\s0
262 Each \s-1ENGINE\s0 specific section is used to set default algorithms, load
263 dynamic, perform initialization and send ctrls. The actual operation performed
264 depends on the \fIcommand\fR name which is the name of the name value pair. The
265 currently supported commands are listed below.
272 \& # Configure ENGINE named "foo"
274 \& # Configure ENGINE named "bar"
278 \& ... foo ENGINE specific commands ...
281 \& ... "bar" ENGINE specific commands ...
284 The command \fBengine_id\fR is used to give the \s-1ENGINE\s0 name. If used this
285 command must be first. For example:
289 \& # This would normally handle an ENGINE named "foo"
293 \& # Override default name and use "myfoo" instead.
297 The command \fBdynamic_path\fR loads and adds an \s-1ENGINE\s0 from the given path. It
298 is equivalent to sending the ctrls \fB\s-1SO_PATH\s0\fR with the path argument followed
299 by \fB\s-1LIST_ADD\s0\fR with value 2 and \fB\s-1LOAD\s0\fR to the dynamic \s-1ENGINE.\s0 If this is
300 not the required behaviour then alternative ctrls can be sent directly
301 to the dynamic \s-1ENGINE\s0 using ctrl commands.
303 The command \fBinit\fR determines whether to initialize the \s-1ENGINE.\s0 If the value
304 is \fB0\fR the \s-1ENGINE\s0 will not be initialized, if \fB1\fR and attempt it made to
305 initialized the \s-1ENGINE\s0 immediately. If the \fBinit\fR command is not present
306 then an attempt will be made to initialize the \s-1ENGINE\s0 after all commands in
307 its section have been processed.
309 The command \fBdefault_algorithms\fR sets the default algorithms an \s-1ENGINE\s0 will
310 supply using the functions \fB\f(BIENGINE_set_default_string()\fB\fR
312 If the name matches none of the above command names it is assumed to be a
313 ctrl command which is sent to the \s-1ENGINE.\s0 The value of the command is the
314 argument to the ctrl command. If the value is the string \fB\s-1EMPTY\s0\fR then no
315 value is sent to the command.
322 \& # Configure ENGINE named "foo"
326 \& # Load engine from DSO
327 \& dynamic_path = /some/path/fooengine.so
328 \& # A foo specific ctrl.
329 \& some_ctrl = some_value
330 \& # Another ctrl that doesn\*(Aqt take a value.
331 \& other_ctrl = EMPTY
332 \& # Supply all default algorithms
333 \& default_algorithms = ALL
335 .SS "\s-1EVP CONFIGURATION MODULE\s0"
336 .IX Subsection "EVP CONFIGURATION MODULE"
337 This modules has the name \fBalg_section\fR which points to a section containing
340 Currently the only algorithm command supported is \fBfips_mode\fR whose
341 value should be a boolean string such as \fBon\fR or \fBoff\fR. If the value is
342 \&\fBon\fR this attempt to enter \s-1FIPS\s0 mode. If the call fails or the library is
343 not \s-1FIPS\s0 capable then an error occurs.
348 \& alg_section = evp_settings
356 If a configuration file attempts to expand a variable that doesn't exist
357 then an error is flagged and the file will not load. This can happen
358 if an attempt is made to expand an environment variable that doesn't
359 exist. For example in a previous version of OpenSSL the default OpenSSL
360 master configuration file used the value of \fB\s-1HOME\s0\fR which may not be
361 defined on non Unix systems and would cause an error.
363 This can be worked around by including a \fBdefault\fR section to provide
364 a default value: then if the environment lookup fails the default value
365 will be used instead. For this to work properly the default value must
366 be defined earlier in the configuration file than the expansion. See
367 the \fB\s-1EXAMPLES\s0\fR section for an example of how to do this.
369 If the same variable exists in the same section then all but the last
370 value will be silently ignored. In certain circumstances such as with
371 DNs the same field may occur multiple times. This is usually worked
372 around by ignoring any characters before an initial \fB.\fR e.g.
375 \& 1.OU="My first OU"
376 \& 2.OU="My Second OU"
379 .IX Header "EXAMPLES"
380 Here is a sample configuration file using some of the features
384 \& # This is the default section.
387 \& RANDFILE= ${ENV::HOME}/.rnd
388 \& configdir=$ENV::HOME/config
392 \& # We are now in section one.
394 \& # Quotes permit leading and trailing whitespace
395 \& any = " any variable name "
397 \& other = A string that can \e
398 \& cover several lines \e
399 \& by including \e\e characters
401 \& message = Hello World\en
405 \& greeting = $section_one::message
408 This next example shows how to expand environment variables safely.
410 Suppose you want a variable called \fBtmpfile\fR to refer to a
411 temporary filename. The directory it is placed in can determined by
412 the the \fB\s-1TEMP\s0\fR or \fB\s-1TMP\s0\fR environment variables but they may not be
413 set to any value at all. If you just include the environment variable
414 names and the variable doesn't exist then this will cause an error when
415 an attempt is made to load the configuration file. By making use of the
416 default section both values can be looked up with \fB\s-1TEMP\s0\fR taking
417 priority and \fB/tmp\fR used if neither is defined:
421 \& # The above value is used if TMP isn\*(Aqt in the environment
423 \& # The above value is used if TEMP isn\*(Aqt in the environment
424 \& tmpfile=${ENV::TEMP}/tmp.filename
427 Simple OpenSSL library configuration example to enter \s-1FIPS\s0 mode:
430 \& # Default appname: should match "appname" parameter (if any)
431 \& # supplied to CONF_modules_load_file et al.
432 \& openssl_conf = openssl_conf_section
434 \& [openssl_conf_section]
435 \& # Configuration module list
436 \& alg_section = evp_sect
439 \& # Set to "yes" to enter FIPS mode if supported
443 Note: in the above example you will get an error in non \s-1FIPS\s0 capable versions
446 More complex OpenSSL library configuration. Add \s-1OID\s0 and don't enter \s-1FIPS\s0 mode:
449 \& # Default appname: should match "appname" parameter (if any)
450 \& # supplied to CONF_modules_load_file et al.
451 \& openssl_conf = openssl_conf_section
453 \& [openssl_conf_section]
454 \& # Configuration module list
455 \& alg_section = evp_sect
456 \& oid_section = new_oids
459 \& # This will have no effect as FIPS mode is off by default.
460 \& # Set to "yes" to enter FIPS mode, if supported
464 \& # New OID, just short name
465 \& newoid1 = 1.2.3.4.1
466 \& # New OID shortname and long name
467 \& newoid2 = New OID 2 long name, 1.2.3.4.2
470 The above examples can be used with with any application supporting library
471 configuration if \*(L"openssl_conf\*(R" is modified to match the appropriate \*(L"appname\*(R".
473 For example if the second sample file above is saved to \*(L"example.cnf\*(R" then
477 \& OPENSSL_CONF=example.cnf openssl asn1parse \-genstr OID:1.2.3.4.1
483 \& 0:d=0 hl=2 l= 4 prim: OBJECT :newoid1
486 showing that the \s-1OID \s0\*(L"newoid1\*(R" has been added as \*(L"1.2.3.4.1\*(R".
489 Currently there is no way to include characters using the octal \fB\ennn\fR
490 form. Strings are all null terminated so nulls cannot form part of
493 The escaping isn't quite right: if you want to use sequences like \fB\en\fR
494 you can't use any quote escaping on the same line.
496 Files are loaded in a single pass. This means that an variable expansion
497 will only work if the variables referenced are defined earlier in the
500 .IX Header "SEE ALSO"
501 \&\fIopenssl_x509\fR\|(1), \fIopenssl_req\fR\|(1), \fIopenssl_ca\fR\|(1)