Update files for OpenSSL-1.0.0f import.
[dragonfly.git] / secure / usr.bin / openssl / man / config.5
CommitLineData
e3261593 1.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.19)
984263bc
MD
2.\"
3.\" Standard preamble:
a561f9ff 4.\" ========================================================================
984263bc
MD
5.de Sp \" Vertical space (when we can't use .PP)
6.if t .sp .5v
7.if n .sp
8..
984263bc
MD
9.de Vb \" Begin verbatim text
10.ft CW
11.nf
12.ne \\$1
13..
14.de Ve \" End verbatim text
15.ft R
984263bc
MD
16.fi
17..
18.\" Set up some character translations and predefined strings. \*(-- will
19.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
e257b235
PA
20.\" double quote, and \*(R" will give a right double quote. \*(C+ will
21.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
22.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
23.\" nothing in troff, for use with C<>.
24.tr \(*W-
984263bc
MD
25.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26.ie n \{\
27. ds -- \(*W-
28. ds PI pi
29. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
31. ds L" ""
32. ds R" ""
33. ds C` ""
34. ds C' ""
35'br\}
36.el\{\
37. ds -- \|\(em\|
38. ds PI \(*p
39. ds L" ``
40. ds R" ''
41'br\}
42.\"
e257b235
PA
43.\" Escape single quotes in literal strings from groff's Unicode transform.
44.ie \n(.g .ds Aq \(aq
45.el .ds Aq '
46.\"
a561f9ff 47.\" If the F register is turned on, we'll generate index entries on stderr for
01185282 48.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
a561f9ff
SS
49.\" entries marked with X<> in POD. Of course, you'll have to process the
50.\" output yourself in some meaningful fashion.
e257b235 51.ie \nF \{\
984263bc
MD
52. de IX
53. tm Index:\\$1\t\\n%\t"\\$2"
54..
55. nr % 0
56. rr F
57.\}
e257b235
PA
58.el \{\
59. de IX
60..
61.\}
aac4ff6f 62.\"
984263bc
MD
63.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64.\" Fear. Run. Save yourself. No user-serviceable parts.
984263bc
MD
65. \" fudge factors for nroff and troff
66.if n \{\
67. ds #H 0
68. ds #V .8m
69. ds #F .3m
70. ds #[ \f1
71. ds #] \fP
72.\}
73.if t \{\
74. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
75. ds #V .6m
76. ds #F 0
77. ds #[ \&
78. ds #] \&
79.\}
80. \" simple accents for nroff and troff
81.if n \{\
82. ds ' \&
83. ds ` \&
84. ds ^ \&
85. ds , \&
86. ds ~ ~
87. ds /
88.\}
89.if t \{\
90. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
96.\}
97. \" troff and (daisy-wheel) nroff accents
98.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105.ds ae a\h'-(\w'a'u*4/10)'e
106.ds Ae A\h'-(\w'A'u*4/10)'E
107. \" corrections for vroff
108.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110. \" for low resolution devices (crt and lpr)
111.if \n(.H>23 .if \n(.V>19 \
112\{\
113. ds : e
114. ds 8 ss
115. ds o a
116. ds d- d\h'-1'\(ga
117. ds D- D\h'-1'\(hy
118. ds th \o'bp'
119. ds Th \o'LP'
120. ds ae ae
121. ds Ae AE
122.\}
123.rm #[ #] #H #V #F C
a561f9ff 124.\" ========================================================================
984263bc 125.\"
a561f9ff 126.IX Title "CONFIG 5"
e3261593 127.TH CONFIG 5 "2012-01-04" "1.0.0f" "OpenSSL"
e257b235
PA
128.\" For nroff, turn off justification. Always turn off hyphenation; it makes
129.\" way too many mistakes in technical documents.
130.if n .ad l
131.nh
984263bc 132.SH "NAME"
a561f9ff 133config \- OpenSSL CONF library configuration files
984263bc
MD
134.SH "DESCRIPTION"
135.IX Header "DESCRIPTION"
136The OpenSSL \s-1CONF\s0 library can be used to read configuration files.
137It is used for the OpenSSL master configuration file \fBopenssl.cnf\fR
138and in a few other places like \fB\s-1SPKAC\s0\fR files and certificate extension
a561f9ff
SS
139files for the \fBx509\fR utility. OpenSSL applications can also use the
140\&\s-1CONF\s0 library for their own purposes.
984263bc
MD
141.PP
142A configuration file is divided into a number of sections. Each section
143starts with a line \fB[ section_name ]\fR and ends when a new section is
144started or end of file is reached. A section name can consist of
145alphanumeric characters and underscores.
146.PP
147The first section of a configuration file is special and is referred
148to as the \fBdefault\fR section this is usually unnamed and is from the
149start of file until the first named section. When a name is being looked up
150it is first looked up in a named section (if any) and then the
151default section.
152.PP
153The environment is mapped onto a section called \fB\s-1ENV\s0\fR.
154.PP
155Comments can be included by preceding them with the \fB#\fR character
156.PP
157Each section in a configuration file consists of a number of name and
158value pairs of the form \fBname=value\fR
159.PP
160The \fBname\fR string can contain any alphanumeric characters as well as
161a few punctuation symbols such as \fB.\fR \fB,\fR \fB;\fR and \fB_\fR.
162.PP
163The \fBvalue\fR string consists of the string following the \fB=\fR character
164until end of line with any leading and trailing white space removed.
165.PP
166The value string undergoes variable expansion. This can be done by
e257b235 167including the form \fB\f(CB$var\fB\fR or \fB${var}\fR: this will substitute the value
984263bc 168of the named variable in the current section. It is also possible to
e257b235
PA
169substitute a value from another section using the syntax \fB\f(CB$section::name\fB\fR
170or \fB${section::name}\fR. By using the form \fB\f(CB$ENV::name\fB\fR environment
984263bc 171variables can be substituted. It is also possible to assign values to
a561f9ff 172environment variables by using the name \fBENV::name\fR, this will work
984263bc
MD
173if the program looks up environment variables using the \fB\s-1CONF\s0\fR library
174instead of calling \fB\f(BIgetenv()\fB\fR directly.
175.PP
176It is possible to escape certain characters by using any kind of quote
177or the \fB\e\fR character. By making the last character of a line a \fB\e\fR
178a \fBvalue\fR string can be spread across multiple lines. In addition
179the sequences \fB\en\fR, \fB\er\fR, \fB\eb\fR and \fB\et\fR are recognized.
a561f9ff
SS
180.SH "OPENSSL LIBRARY CONFIGURATION"
181.IX Header "OPENSSL LIBRARY CONFIGURATION"
182In OpenSSL 0.9.7 and later applications can automatically configure certain
183aspects of OpenSSL using the master OpenSSL configuration file, or optionally
184an alternative configuration file. The \fBopenssl\fR utility includes this
185functionality: any sub command uses the master OpenSSL configuration file
186unless an option is used in the sub command to use an alternative configuration
187file.
188.PP
189To enable library configuration the default section needs to contain an
190appropriate line which points to the main configuration section. The default
191name is \fBopenssl_conf\fR which is used by the \fBopenssl\fR utility. Other
192applications may use an alternative name such as \fBmyapplicaton_conf\fR.
193.PP
194The configuration section should consist of a set of name value pairs which
195contain specific module configuration information. The \fBname\fR represents
196the name of the \fIconfiguration module\fR the meaning of the \fBvalue\fR is
197module specific: it may, for example, represent a further configuration
198section containing configuration module specific information. E.g.
199.PP
200.Vb 1
201\& openssl_conf = openssl_init
e257b235 202\&
a561f9ff 203\& [openssl_init]
e257b235 204\&
a561f9ff
SS
205\& oid_section = new_oids
206\& engines = engine_section
e257b235 207\&
a561f9ff 208\& [new_oids]
e257b235 209\&
a561f9ff 210\& ... new oids here ...
e257b235 211\&
a561f9ff 212\& [engine_section]
e257b235 213\&
a561f9ff
SS
214\& ... engine stuff here ...
215.Ve
216.PP
217Currently there are two configuration modules. One for \s-1ASN1\s0 objects another
218for \s-1ENGINE\s0 configuration.
01185282 219.SS "\s-1ASN1\s0 \s-1OBJECT\s0 \s-1CONFIGURATION\s0 \s-1MODULE\s0"
a561f9ff
SS
220.IX Subsection "ASN1 OBJECT CONFIGURATION MODULE"
221This module has the name \fBoid_section\fR. The value of this variable points
222to a section containing name value pairs of OIDs: the name is the \s-1OID\s0 short
223and long name, the value is the numerical form of the \s-1OID\s0. Although some of
224the \fBopenssl\fR utility sub commands already have their own \s-1ASN1\s0 \s-1OBJECT\s0 section
225functionality not all do. By using the \s-1ASN1\s0 \s-1OBJECT\s0 configuration module
226\&\fBall\fR the \fBopenssl\fR utility sub commands can see the new objects as well
227as any compliant applications. For example:
228.PP
229.Vb 1
230\& [new_oids]
e257b235 231\&
a561f9ff
SS
232\& some_new_oid = 1.2.3.4
233\& some_other_oid = 1.2.3.5
234.Ve
235.PP
236In OpenSSL 0.9.8 it is also possible to set the value to the long name followed
237by a comma and the numerical \s-1OID\s0 form. For example:
238.PP
239.Vb 1
240\& shortName = some object long name, 1.2.3.4
241.Ve
01185282 242.SS "\s-1ENGINE\s0 \s-1CONFIGURATION\s0 \s-1MODULE\s0"
a561f9ff
SS
243.IX Subsection "ENGINE CONFIGURATION MODULE"
244This \s-1ENGINE\s0 configuration module has the name \fBengines\fR. The value of this
245variable points to a section containing further \s-1ENGINE\s0 configuration
246information.
247.PP
248The section pointed to by \fBengines\fR is a table of engine names (though see
249\&\fBengine_id\fR below) and further sections containing configuration informations
250specific to each \s-1ENGINE\s0.
251.PP
252Each \s-1ENGINE\s0 specific section is used to set default algorithms, load
253dynamic, perform initialization and send ctrls. The actual operation performed
254depends on the \fIcommand\fR name which is the name of the name value pair. The
255currently supported commands are listed below.
256.PP
257For example:
258.PP
259.Vb 1
260\& [engine_section]
e257b235 261\&
a561f9ff
SS
262\& # Configure ENGINE named "foo"
263\& foo = foo_section
264\& # Configure ENGINE named "bar"
265\& bar = bar_section
e257b235 266\&
a561f9ff
SS
267\& [foo_section]
268\& ... foo ENGINE specific commands ...
e257b235 269\&
a561f9ff
SS
270\& [bar_section]
271\& ... "bar" ENGINE specific commands ...
272.Ve
273.PP
274The command \fBengine_id\fR is used to give the \s-1ENGINE\s0 name. If used this
275command must be first. For example:
276.PP
277.Vb 3
278\& [engine_section]
279\& # This would normally handle an ENGINE named "foo"
280\& foo = foo_section
e257b235 281\&
a561f9ff
SS
282\& [foo_section]
283\& # Override default name and use "myfoo" instead.
284\& engine_id = myfoo
285.Ve
286.PP
287The command \fBdynamic_path\fR loads and adds an \s-1ENGINE\s0 from the given path. It
288is equivalent to sending the ctrls \fB\s-1SO_PATH\s0\fR with the path argument followed
289by \fB\s-1LIST_ADD\s0\fR with value 2 and \fB\s-1LOAD\s0\fR to the dynamic \s-1ENGINE\s0. If this is
290not the required behaviour then alternative ctrls can be sent directly
291to the dynamic \s-1ENGINE\s0 using ctrl commands.
292.PP
293The command \fBinit\fR determines whether to initialize the \s-1ENGINE\s0. If the value
294is \fB0\fR the \s-1ENGINE\s0 will not be initialized, if \fB1\fR and attempt it made to
295initialized the \s-1ENGINE\s0 immediately. If the \fBinit\fR command is not present
296then an attempt will be made to initialize the \s-1ENGINE\s0 after all commands in
297its section have been processed.
298.PP
299The command \fBdefault_algorithms\fR sets the default algorithms an \s-1ENGINE\s0 will
300supply using the functions \fB\f(BIENGINE_set_default_string()\fB\fR
301.PP
302If the name matches none of the above command names it is assumed to be a
303ctrl command which is sent to the \s-1ENGINE\s0. The value of the command is the
304argument to the ctrl command. If the value is the string \fB\s-1EMPTY\s0\fR then no
305value is sent to the command.
306.PP
307For example:
308.PP
309.Vb 1
310\& [engine_section]
e257b235 311\&
a561f9ff
SS
312\& # Configure ENGINE named "foo"
313\& foo = foo_section
e257b235 314\&
a561f9ff
SS
315\& [foo_section]
316\& # Load engine from DSO
317\& dynamic_path = /some/path/fooengine.so
318\& # A foo specific ctrl.
319\& some_ctrl = some_value
e257b235 320\& # Another ctrl that doesn\*(Aqt take a value.
a561f9ff
SS
321\& other_ctrl = EMPTY
322\& # Supply all default algorithms
323\& default_algorithms = ALL
324.Ve
984263bc
MD
325.SH "NOTES"
326.IX Header "NOTES"
327If a configuration file attempts to expand a variable that doesn't exist
328then an error is flagged and the file will not load. This can happen
329if an attempt is made to expand an environment variable that doesn't
a561f9ff
SS
330exist. For example in a previous version of OpenSSL the default OpenSSL
331master configuration file used the value of \fB\s-1HOME\s0\fR which may not be
332defined on non Unix systems and would cause an error.
984263bc
MD
333.PP
334This can be worked around by including a \fBdefault\fR section to provide
335a default value: then if the environment lookup fails the default value
336will be used instead. For this to work properly the default value must
337be defined earlier in the configuration file than the expansion. See
338the \fB\s-1EXAMPLES\s0\fR section for an example of how to do this.
339.PP
340If the same variable exists in the same section then all but the last
341value will be silently ignored. In certain circumstances such as with
342DNs the same field may occur multiple times. This is usually worked
343around by ignoring any characters before an initial \fB.\fR e.g.
344.PP
345.Vb 2
346\& 1.OU="My first OU"
347\& 2.OU="My Second OU"
348.Ve
349.SH "EXAMPLES"
350.IX Header "EXAMPLES"
351Here is a sample configuration file using some of the features
352mentioned above.
353.PP
354.Vb 1
355\& # This is the default section.
e257b235 356\&
984263bc
MD
357\& HOME=/temp
358\& RANDFILE= ${ENV::HOME}/.rnd
359\& configdir=$ENV::HOME/config
e257b235 360\&
984263bc 361\& [ section_one ]
e257b235 362\&
984263bc 363\& # We are now in section one.
e257b235 364\&
984263bc
MD
365\& # Quotes permit leading and trailing whitespace
366\& any = " any variable name "
e257b235 367\&
984263bc
MD
368\& other = A string that can \e
369\& cover several lines \e
370\& by including \e\e characters
e257b235 371\&
984263bc 372\& message = Hello World\en
e257b235 373\&
984263bc 374\& [ section_two ]
e257b235 375\&
984263bc
MD
376\& greeting = $section_one::message
377.Ve
a561f9ff 378.PP
984263bc
MD
379This next example shows how to expand environment variables safely.
380.PP
381Suppose you want a variable called \fBtmpfile\fR to refer to a
382temporary filename. The directory it is placed in can determined by
383the the \fB\s-1TEMP\s0\fR or \fB\s-1TMP\s0\fR environment variables but they may not be
384set to any value at all. If you just include the environment variable
385names and the variable doesn't exist then this will cause an error when
386an attempt is made to load the configuration file. By making use of the
387default section both values can be looked up with \fB\s-1TEMP\s0\fR taking
388priority and \fB/tmp\fR used if neither is defined:
389.PP
390.Vb 5
391\& TMP=/tmp
e257b235 392\& # The above value is used if TMP isn\*(Aqt in the environment
984263bc 393\& TEMP=$ENV::TMP
e257b235 394\& # The above value is used if TEMP isn\*(Aqt in the environment
984263bc
MD
395\& tmpfile=${ENV::TEMP}/tmp.filename
396.Ve
397.SH "BUGS"
398.IX Header "BUGS"
399Currently there is no way to include characters using the octal \fB\ennn\fR
400form. Strings are all null terminated so nulls cannot form part of
401the value.
402.PP
403The escaping isn't quite right: if you want to use sequences like \fB\en\fR
404you can't use any quote escaping on the same line.
405.PP
406Files are loaded in a single pass. This means that an variable expansion
407will only work if the variables referenced are defined earlier in the
408file.
409.SH "SEE ALSO"
410.IX Header "SEE ALSO"
a561f9ff 411\&\fIx509\fR\|(1), \fIreq\fR\|(1), \fIca\fR\|(1)