]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_ssl.xml
70a4b3c56a58578bfef8dee3e4a37f50f2571dcc
[apache] / docs / manual / mod / mod_ssl.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
5
6 <!--
7  Copyright 2002-2005 The Apache Software Foundation or its licensors, as
8  applicable.
9
10  Licensed under the Apache License, Version 2.0 (the "License");
11  you may not use this file except in compliance with the License.
12  You may obtain a copy of the License at
13
14      http://www.apache.org/licenses/LICENSE-2.0
15
16  Unless required by applicable law or agreed to in writing, software
17  distributed under the License is distributed on an "AS IS" BASIS,
18  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  See the License for the specific language governing permissions and
20  limitations under the License.
21 -->
22
23 <modulesynopsis metafile="mod_ssl.xml.meta">
24
25 <name>mod_ssl</name>
26 <description>Strong cryptography using the Secure Sockets
27 Layer (SSL) and Transport Layer Security (TLS) protocols</description>
28 <status>Extension</status>
29 <sourcefile>mod_ssl.c</sourcefile>
30 <identifier>ssl_module</identifier>
31
32 <summary>
33 <p>This module provides SSL v2/v3 and TLS v1 support for the Apache
34 HTTP Server.  It was contributed by Ralf S. Engeschall based on his
35 mod_ssl project and originally derived from work by Ben Laurie.</p>
36
37 <p>This module relies on <a href="http://www.openssl.org/">OpenSSL</a>
38 to provide the cryptography engine.</p>
39
40 <p>Further details, discussion, and examples are provided in the
41 <a href="../ssl/">SSL documentation</a>.</p>
42 </summary>
43
44 <section id="envvars"><title>Environment Variables</title>
45
46 <p>This module provides a lot of SSL information as additional environment
47 variables to the SSI and CGI namespace. The generated variables are listed in
48 the table below. For backward compatibility the information can
49 be made available under different names, too. Look in the <a
50 href="../ssl/ssl_compat.html">Compatibility</a> chapter for details on the
51 compatibility variables.</p>
52
53 <table border="1">
54 <columnspec><column width=".3"/><column width=".2"/><column width=".5"/>
55 </columnspec>
56 <tr>
57  <th><a name="table3">Variable Name:</a></th>
58  <th>Value Type:</th>
59  <th>Description:</th>
60 </tr>
61 <tr><td><code>HTTPS</code></td>                         <td>flag</td>      <td>HTTPS is being used.</td></tr>
62 <tr><td><code>SSL_PROTOCOL</code></td>                  <td>string</td>    <td>The SSL protocol version (SSLv2, SSLv3, TLSv1)</td></tr>
63 <tr><td><code>SSL_SESSION_ID</code></td>                <td>string</td>    <td>The hex-encoded SSL session id</td></tr>
64 <tr><td><code>SSL_CIPHER</code></td>                    <td>string</td>    <td>The cipher specification name</td></tr>
65 <tr><td><code>SSL_CIPHER_EXPORT</code></td>             <td>string</td>    <td><code>true</code> if cipher is an export cipher</td></tr>
66 <tr><td><code>SSL_CIPHER_USEKEYSIZE</code></td>         <td>number</td>    <td>Number of cipher bits (actually used)</td></tr>
67 <tr><td><code>SSL_CIPHER_ALGKEYSIZE</code></td>         <td>number</td>    <td>Number of cipher bits (possible)</td></tr>
68 <tr><td><code>SSL_COMPRESS_METHOD</code></td>           <td>string</td>    <td>SSL compression method negotiated</td></tr>
69 <tr><td><code>SSL_VERSION_INTERFACE</code></td>         <td>string</td>    <td>The mod_ssl program version</td></tr>
70 <tr><td><code>SSL_VERSION_LIBRARY</code></td>           <td>string</td>    <td>The OpenSSL program version</td></tr>
71 <tr><td><code>SSL_CLIENT_M_VERSION</code></td>          <td>string</td>    <td>The version of the client certificate</td></tr>
72 <tr><td><code>SSL_CLIENT_M_SERIAL</code></td>           <td>string</td>    <td>The serial of the client certificate</td></tr>
73 <tr><td><code>SSL_CLIENT_S_DN</code></td>               <td>string</td>    <td>Subject DN in client's certificate</td></tr>
74 <tr><td><code>SSL_CLIENT_S_DN_</code><em>x509</em></td> <td>string</td>    <td>Component of client's Subject DN</td></tr>
75 <tr><td><code>SSL_CLIENT_I_DN</code></td>               <td>string</td>    <td>Issuer DN of client's certificate</td></tr>
76 <tr><td><code>SSL_CLIENT_I_DN_</code><em>x509</em></td> <td>string</td>    <td>Component of client's Issuer DN</td></tr>
77 <tr><td><code>SSL_CLIENT_V_START</code></td>            <td>string</td>    <td>Validity of client's certificate (start time)</td></tr>
78 <tr><td><code>SSL_CLIENT_V_END</code></td>              <td>string</td>    <td>Validity of client's certificate (end time)</td></tr>
79 <tr><td><code>SSL_CLIENT_V_REMAIN</code></td>           <td>string</td>    <td>Number of days until client's certificate expires</td></tr>
80 <tr><td><code>SSL_CLIENT_A_SIG</code></td>              <td>string</td>    <td>Algorithm used for the signature of client's certificate</td></tr>
81 <tr><td><code>SSL_CLIENT_A_KEY</code></td>              <td>string</td>    <td>Algorithm used for the public key of client's certificate</td></tr>
82 <tr><td><code>SSL_CLIENT_CERT</code></td>               <td>string</td>    <td>PEM-encoded client certificate</td></tr>
83 <tr><td><code>SSL_CLIENT_CERT_CHAIN_</code><em>n</em></td> <td>string</td>    <td>PEM-encoded certificates in client certificate chain</td></tr>
84 <tr><td><code>SSL_CLIENT_VERIFY</code></td>             <td>string</td>    <td><code>NONE</code>, <code>SUCCESS</code>, <code>GENEROUS</code> or <code>FAILED:</code><em>reason</em></td></tr>
85 <tr><td><code>SSL_SERVER_M_VERSION</code></td>          <td>string</td>    <td>The version of the server certificate</td></tr>
86 <tr><td><code>SSL_SERVER_M_SERIAL</code></td>           <td>string</td>    <td>The serial of the server certificate</td></tr>
87 <tr><td><code>SSL_SERVER_S_DN</code></td>               <td>string</td>    <td>Subject DN in server's certificate</td></tr>
88 <tr><td><code>SSL_SERVER_S_DN_</code><em>x509</em></td> <td>string</td>    <td>Component of server's Subject DN</td></tr>
89 <tr><td><code>SSL_SERVER_I_DN</code></td>               <td>string</td>    <td>Issuer DN of server's certificate</td></tr>
90 <tr><td><code>SSL_SERVER_I_DN_</code><em>x509</em></td> <td>string</td>    <td>Component of server's Issuer DN</td></tr>
91 <tr><td><code>SSL_SERVER_V_START</code></td>            <td>string</td>    <td>Validity of server's certificate (start time)</td></tr>
92 <tr><td><code>SSL_SERVER_V_END</code></td>              <td>string</td>    <td>Validity of server's certificate (end time)</td></tr>
93 <tr><td><code>SSL_SERVER_A_SIG</code></td>              <td>string</td>    <td>Algorithm used for the signature of server's certificate</td></tr>
94 <tr><td><code>SSL_SERVER_A_KEY</code></td>              <td>string</td>    <td>Algorithm used for the public key of server's certificate</td></tr>
95 <tr><td><code>SSL_SERVER_CERT</code></td>               <td>string</td>    <td>PEM-encoded server certificate</td></tr>
96 </table>
97
98 <p><em>x509</em> specifies a component of an X.509 DN; one of
99 <code>C,ST,L,O,OU,CN,T,I,G,S,D,UID,Email</code>.  In Apache 2.1 and
100 later, <em>x509</em> may also include a numeric <code>_n</code>
101 suffix.  If the DN in question contains multiple attributes of the
102 same name, this suffix is used as an index to select a particular
103 attribute.  For example, where the server certificate subject DN
104 included two OU fields, <code>SSL_SERVER_S_DN_OU_0</code> and
105 <code>SSL_SERVER_S_DN_OU_1</code> could be used to reference each.</p>
106
107 <p><code>SSL_CLIENT_V_REMAIN</code> is only available in version 2.1
108 and later.</p>
109
110 </section>
111
112 <section id="logformats"><title>Custom Log Formats</title>
113
114 <p>When <module>mod_ssl</module> is built into Apache or at least
115 loaded (under DSO situation) additional functions exist for the <a
116 href="mod_log_config.html#formats">Custom Log Format</a> of 
117 <module>mod_log_config</module>. First there is an
118 additional ``<code>%{</code><em>varname</em><code>}x</code>''
119 eXtension format function which can be used to expand any variables
120 provided by any module, especially those provided by mod_ssl which can
121 you find in the above table.</p>
122 <p>
123 For backward compatibility there is additionally a special
124 ``<code>%{</code><em>name</em><code>}c</code>'' cryptography format function
125 provided. Information about this function is provided in the <a
126 href="../ssl/ssl_compat.html">Compatibility</a> chapter.</p>
127 <example><title>Example</title>
128 CustomLog logs/ssl_request_log \
129           "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
130 </example>
131 </section>
132
133 <directivesynopsis>
134 <name>SSLPassPhraseDialog</name>
135 <description>Type of pass phrase dialog for encrypted private 
136 keys</description>
137 <syntax>SSLPassPhraseDialog <em>type</em></syntax>
138 <default>SSLPassPhraseDialog builtin</default>
139 <contextlist><context>server config</context></contextlist>
140
141 <usage>
142 <p>
143 When Apache starts up it has to read the various Certificate (see
144 <directive module="mod_ssl">SSLCertificateFile</directive>) and
145 Private Key (see <directive
146 module="mod_ssl">SSLCertificateKeyFile</directive>) files of the
147 SSL-enabled virtual servers. Because for security reasons the Private
148 Key files are usually encrypted, mod_ssl needs to query the
149 administrator for a Pass Phrase in order to decrypt those files. This
150 query can be done in two ways which can be configured by
151 <em>type</em>:</p>
152 <ul>
153 <li><code>builtin</code>
154     <p>
155     This is the default where an interactive terminal dialog occurs at startup
156     time just before Apache detaches from the terminal. Here the administrator
157     has to manually enter the Pass Phrase for each encrypted Private Key file.
158     Because a lot of SSL-enabled virtual hosts can be configured, the
159     following reuse-scheme is used to minimize the dialog: When a Private Key
160     file is encrypted, all known Pass Phrases (at the beginning there are
161     none, of course) are tried. If one of those known Pass Phrases succeeds no
162     dialog pops up for this particular Private Key file. If none succeeded,
163     another Pass Phrase is queried on the terminal and remembered for the next
164     round (where it perhaps can be reused).</p>
165     <p>
166     This scheme allows mod_ssl to be maximally flexible (because for N encrypted
167     Private Key files you <em>can</em> use N different Pass Phrases - but then
168     you have to enter all of them, of course) while minimizing the terminal
169     dialog (i.e. when you use a single Pass Phrase for all N Private Key files
170     this Pass Phrase is queried only once).</p></li>
171
172 <li><code>|/path/to/program [args...]</code> 
173
174    <p>This mode allows an external program to be used which acts as a
175    pipe to a particular input device; the program is sent the standard
176    prompt text used for the <code>builtin</code> mode on
177    <code>stdin</code>, and is expected to write password strings on
178    <code>stdout</code>.  If several passwords are needed (or an
179    incorrect password is entered), additional prompt text will be
180    written subsequent to the first password being returned, and more
181    passwords must then be written back.</p></li>
182
183 <li><code>exec:/path/to/program</code>
184     <p>
185     Here an external program is configured which is called at startup for each
186     encrypted Private Key file. It is called with two arguments (the first is
187     of the form ``<code>servername:portnumber</code>'', the second is either
188     ``<code>RSA</code>'' or ``<code>DSA</code>''), which indicate for which
189     server and algorithm it has to print the corresponding Pass Phrase to
190     <code>stdout</code>. The intent is that this external program first runs
191     security checks to make sure that the system is not compromised by an
192     attacker, and only when these checks were passed successfully it provides
193     the Pass Phrase.</p>
194     <p>
195     Both these security checks, and the way the Pass Phrase is determined, can
196     be as complex as you like. Mod_ssl just defines the interface: an
197     executable program which provides the Pass Phrase on <code>stdout</code>.
198     Nothing more or less! So, if you're really paranoid about security, here
199     is your interface. Anything else has to be left as an exercise to the
200     administrator, because local security requirements are so different.</p>
201     <p>
202     The reuse-algorithm above is used here, too. In other words: The external
203     program is called only once per unique Pass Phrase.</p></li>
204 </ul>
205 <example><title>Example</title>
206 SSLPassPhraseDialog exec:/usr/local/apache/sbin/pp-filter
207 </example>
208 </usage>
209 </directivesynopsis>
210
211 <directivesynopsis>
212 <name>SSLMutex</name>
213 <description>Semaphore for internal mutual exclusion of 
214 operations</description>
215 <syntax>SSLMutex <em>type</em></syntax>
216 <default>SSLMutex none</default>
217 <contextlist><context>server config</context></contextlist>
218
219 <usage>
220 <p>
221 This configures the SSL engine's semaphore (aka. lock) which is used for mutual
222 exclusion of operations which have to be done in a synchronized way between the
223 pre-forked Apache server processes. This directive can only be used in the
224 global server context because it's only useful to have one global mutex.
225 This directive is designed to closely match the
226 <directive module="mpm_common">AcceptMutex</directive> directive.</p>
227 <p>
228 The following Mutex <em>types</em> are available:</p>
229 <ul>
230 <li><code>none | no</code>
231     <p>
232     This is the default where no Mutex is used at all. Use it at your own
233     risk. But because currently the Mutex is mainly used for synchronizing
234     write access to the SSL Session Cache you can live without it as long
235     as you accept a sometimes garbled Session Cache. So it's not recommended
236     to leave this the default. Instead configure a real Mutex.</p></li>
237 <li><code>posixsem</code>
238     <p>
239     This is an elegant Mutex variant where a Posix Semaphore is used when possible.
240     It is only available when the underlying platform
241     and <glossary>APR</glossary> supports it.</p></li>
242 <li><code>sysvsem</code>
243     <p>
244     This is a somewhat elegant Mutex variant where a SystemV IPC Semaphore is used when
245     possible. It is possible to "leak" SysV semaphores if processes crash before
246     the semaphore is removed. It is only available when the underlying platform
247     and <glossary>APR</glossary> supports it.</p></li>
248 <li><code>sem</code>
249     <p>
250     This directive tells the SSL Module to pick the "best" semaphore implementation
251     available to it, choosing between Posix and SystemV IPC, in that order. It is only
252     available when the underlying platform and <glossary>APR</glossary> supports at least one of the 2.</p></li>
253 <li><code>pthread</code>
254     <p>
255     This directive tells the SSL Module to use Posix thread mutexes. It is only available
256     if the underlying platform and <glossary>APR</glossary> supports it.</p></li>
257 <li><code>fcntl:/path/to/mutex</code>
258     <p>
259     This is a portable Mutex variant where a physical (lock-)file and the <code>fcntl()</code>
260     fucntion are used as the Mutex.
261     Always use a local disk filesystem for <code>/path/to/mutex</code> and never a file
262     residing on a NFS- or AFS-filesystem. It is only available when the underlying platform
263     and <glossary>APR</glossary> supports it. Note: Internally, the Process ID (PID) of the
264     Apache parent process is automatically appended to
265     <code>/path/to/mutex</code> to make it unique, so you don't have to worry
266     about conflicts yourself. Notice that this type of mutex is not available
267     under the Win32 environment. There you <em>have</em> to use the semaphore
268     mutex.</p></li>
269 <li><code>flock:/path/to/mutex</code>
270     <p>
271     This is similar to the <code>fcntl:/path/to/mutex</code> method with the
272     exception that the <code>flock()</code> function is used to provide file
273     locking. It is only available when the underlying platform
274     and <glossary>APR</glossary> supports it.</p></li>
275 <li><code>file:/path/to/mutex</code>
276     <p>
277     This directive tells the SSL Module to pick the "best" file locking implementation
278     available to it, choosing between <code>fcntl</code> and <code>flock</code>,
279     in that order. It is only available when the underlying platform and <glossary>APR</glossary> supports
280     at least one of the 2.</p></li>
281 <li><code>default | yes</code>
282     <p>
283     This directive tells the SSL Module to pick the default locking implementation
284     as determined by the platform and <glossary>APR</glossary>.</p></li>
285 </ul>
286 <example><title>Example</title>
287 SSLMutex file:/usr/local/apache/logs/ssl_mutex
288 </example>
289 </usage>
290 </directivesynopsis>
291
292 <directivesynopsis>
293 <name>SSLRandomSeed</name>
294 <description>Pseudo Random Number Generator (PRNG) seeding 
295 source</description>
296 <syntax>SSLRandomSeed <em>context</em> <em>source</em> 
297 [<em>bytes</em>]</syntax>
298 <contextlist><context>server config</context></contextlist>
299
300 <usage>
301 <p>
302 This configures one or more sources for seeding the Pseudo Random Number
303 Generator (PRNG) in OpenSSL at startup time (<em>context</em> is
304 <code>startup</code>) and/or just before a new SSL connection is established
305 (<em>context</em> is <code>connect</code>). This directive can only be used
306 in the global server context because the PRNG is a global facility.</p>
307 <p>
308 The following <em>source</em> variants are available:</p>
309 <ul>
310 <li><code>builtin</code>
311     <p> This is the always available builtin seeding source. It's usage
312     consumes minimum CPU cycles under runtime and hence can be always used
313     without drawbacks. The source used for seeding the PRNG contains of the
314     current time, the current process id and (when applicable) a randomly
315     choosen 1KB extract of the inter-process scoreboard structure of Apache.
316     The drawback is that this is not really a strong source and at startup
317     time (where the scoreboard is still not available) this source just
318     produces a few bytes of entropy. So you should always, at least for the
319     startup, use an additional seeding source.</p></li>
320 <li><code>file:/path/to/source</code>
321     <p>
322     This variant uses an external file <code>/path/to/source</code> as the
323     source for seeding the PRNG. When <em>bytes</em> is specified, only the
324     first <em>bytes</em> number of bytes of the file form the entropy (and
325     <em>bytes</em> is given to <code>/path/to/source</code> as the first
326     argument). When <em>bytes</em> is not specified the whole file forms the
327     entropy (and <code>0</code> is given to <code>/path/to/source</code> as
328     the first argument). Use this especially at startup time, for instance
329     with an available <code>/dev/random</code> and/or
330     <code>/dev/urandom</code> devices (which usually exist on modern Unix
331     derivates like FreeBSD and Linux).</p>
332     <p>
333     <em>But be careful</em>: Usually <code>/dev/random</code> provides only as
334     much entropy data as it actually has, i.e. when you request 512 bytes of
335     entropy, but the device currently has only 100 bytes available two things
336     can happen: On some platforms you receive only the 100 bytes while on
337     other platforms the read blocks until enough bytes are available (which
338     can take a long time). Here using an existing <code>/dev/urandom</code> is
339     better, because it never blocks and actually gives the amount of requested
340     data. The drawback is just that the quality of the received data may not
341     be the best.</p>
342     <p>
343     On some platforms like FreeBSD one can even control how the entropy is
344     actually generated, i.e. by which system interrupts. More details one can
345     find under <em>rndcontrol(8)</em> on those platforms. Alternatively, when
346     your system lacks such a random device, you can use tool
347     like <a href="http://www.lothar.com/tech/crypto/">EGD</a>
348     (Entropy Gathering Daemon) and run it's client program with the
349     <code>exec:/path/to/program/</code> variant (see below) or use
350     <code>egd:/path/to/egd-socket</code> (see below).</p></li>
351
352 <li><code>exec:/path/to/program</code>
353     <p>
354     This variant uses an external executable
355     <code>/path/to/program</code> as the source for seeding the
356     PRNG. When <em>bytes</em> is specified, only the first
357     <em>bytes</em> number of bytes of its <code>stdout</code> contents
358     form the entropy. When <em>bytes</em> is not specified, the
359     entirety of the data produced on <code>stdout</code> form the
360     entropy. Use this only at startup time when you need a very strong
361     seeding with the help of an external program (for instance as in
362     the example above with the <code>truerand</code> utility you can
363     find in the mod_ssl distribution which is based on the AT&amp;T
364     <em>truerand</em> library). Using this in the connection context
365     slows down the server too dramatically, of course.  So usually you
366     should avoid using external programs in that context.</p></li>
367 <li><code>egd:/path/to/egd-socket</code> (Unix only)
368     <p>
369     This variant uses the Unix domain socket of the
370     external Entropy Gathering Daemon (EGD) (see <a
371     href="http://www.lothar.com/tech/crypto/">http://www.lothar.com/tech
372     /crypto/</a>) to seed the PRNG. Use this if no random device exists
373     on your platform.</p></li>
374 </ul>
375 <example><title>Example</title>
376 SSLRandomSeed startup builtin<br />
377 SSLRandomSeed startup file:/dev/random<br />
378 SSLRandomSeed startup file:/dev/urandom 1024<br />
379 SSLRandomSeed startup exec:/usr/local/bin/truerand 16<br />
380 SSLRandomSeed connect builtin<br />
381 SSLRandomSeed connect file:/dev/random<br />
382 SSLRandomSeed connect file:/dev/urandom 1024<br />
383 </example>
384 </usage>
385 </directivesynopsis>
386
387 <directivesynopsis>
388 <name>SSLSessionCache</name>
389 <description>Type of the global/inter-process SSL Session 
390 Cache</description>
391 <syntax>SSLSessionCache <em>type</em></syntax>
392 <default>SSLSessionCache none</default>
393 <contextlist><context>server config</context></contextlist>
394
395 <usage>
396 <p>
397 This configures the storage type of the global/inter-process SSL Session
398 Cache. This cache is an optional facility which speeds up parallel request
399 processing. For requests to the same server process (via HTTP keep-alive),
400 OpenSSL already caches the SSL session information locally. But because modern
401 clients request inlined images and other data via parallel requests (usually
402 up to four parallel requests are common) those requests are served by
403 <em>different</em> pre-forked server processes. Here an inter-process cache
404 helps to avoid unneccessary session handshakes.</p>
405 <p>
406 The following four storage <em>type</em>s are currently supported:</p>
407 <ul>
408 <li><code>none</code>
409
410     <p>This disables the global/inter-process Session Cache.  This
411     will incur a noticeable speed penalty and may cause problems if
412     using certain browsers, particularly if client certificates are
413     enabled.  This setting is not recommended.</p></li>
414
415 <li><code>nonenotnull</code>
416
417     <p>This disables any global/inter-process Session Cache.  However
418     it does force OpenSSL to send a non-null session ID to
419     accommodate buggy clients that require one.</p></li>
420
421 <li><code>dbm:/path/to/datafile</code>
422
423     <p>This makes use of a DBM hashfile on the local disk to
424     synchronize the local OpenSSL memory caches of the server
425     processes.  This session cache may suffer reliability issues under
426     high load.</p></li>
427
428 <li><code>shm:/path/to/datafile</code>[<code>(</code><em>size</em><code>)</code>]
429
430     <p>This makes use of a high-performance cyclic buffer
431     (approx. <em>size</em> bytes in size) inside a shared memory
432     segment in RAM (established via <code>/path/to/datafile</code>) to
433     synchronize the local OpenSSL memory caches of the server
434     processes.  This is the recommended session cache.</p></li>
435
436 <li><code>dc:UNIX:/path/to/socket</code>
437
438     <p>This makes use of the <a
439     href="http://www.distcache.org/">distcache</a> distributed session
440     caching libraries.  The argument should specify the location of
441     the server or proxy to be used using the distcache address syntax;
442     for example, <code>UNIX:/path/to/socket</code> specifies a UNIX
443     domain socket (typically a local dc_client proxy);
444     <code>IP:server.example.com:9001</code> specifies an IP
445     address.</p></li>
446
447 </ul>
448 <example><title>Examples</title>
449 SSLSessionCache dbm:/usr/local/apache/logs/ssl_gcache_data<br />
450 SSLSessionCache shm:/usr/local/apache/logs/ssl_gcache_data(512000)
451 </example>
452 </usage>
453 </directivesynopsis>
454
455 <directivesynopsis>
456 <name>SSLSessionCacheTimeout</name>
457 <description>Number of seconds before an SSL session expires
458 in the Session Cache</description>
459 <syntax>SSLSessionCacheTimeout <em>seconds</em></syntax>
460 <default>SSLSessionCacheTimeout 300</default>
461 <contextlist><context>server config</context>
462 <context>virtual host</context></contextlist>
463
464 <usage>
465 <p>
466 This directive sets the timeout in seconds for the information stored in the
467 global/inter-process SSL Session Cache and the OpenSSL internal memory cache.
468 It can be set as low as 15 for testing, but should be set to higher
469 values like 300 in real life.</p>
470 <example><title>Example</title>
471 SSLSessionCacheTimeout 600
472 </example>
473 </usage>
474 </directivesynopsis>
475
476 <directivesynopsis>
477 <name>SSLEngine</name>
478 <description>SSL Engine Operation Switch</description>
479 <syntax>SSLEngine on|off|optional</syntax>
480 <default>SSLEngine off</default>
481 <contextlist><context>server config</context>
482 <context>virtual host</context></contextlist>
483
484 <usage>
485 <p>
486 This directive toggles the usage of the SSL/TLS Protocol Engine. This
487 is usually used inside a <directive module="core"
488 type="section">VirtualHost</directive> section to enable SSL/TLS for a
489 particular virtual host. By default the SSL/TLS Protocol Engine is
490 disabled for both the main server and all configured virtual hosts.</p>
491 <example><title>Example</title>
492 &lt;VirtualHost _default_:443&gt;<br />
493 SSLEngine on<br />
494 ...<br />
495 &lt;/VirtualHost&gt;
496 </example>
497 <p>In Apache 2.1 and later, <directive>SSLEngine</directive> can be set to 
498 <code>optional</code>. This enables support for 
499 <a href="http://www.ietf.org/rfc/rfc2817.txt">RFC 2817</a>, Upgrading to TLS 
500 Within HTTP/1.1. At this time no web browsers support RFC 2817.</p>
501 </usage>
502 </directivesynopsis>
503
504 <directivesynopsis>
505 <name>SSLProtocol</name>
506 <description>Configure usable SSL protocol flavors</description>
507 <syntax>SSLProtocol [+|-]<em>protocol</em> ...</syntax>
508 <default>SSLProtocol all</default>
509 <contextlist><context>server config</context>
510 <context>virtual host</context></contextlist>
511 <override>Options</override>
512
513 <usage><!-- XXX Why does this have an override and not .htaccess context? -->
514 <p>
515 This directive can be used to control the SSL protocol flavors mod_ssl should
516 use when establishing its server environment. Clients then can only connect
517 with one of the provided protocols.</p>
518 <p>
519 The available (case-insensitive) <em>protocol</em>s are:</p>
520 <ul>
521 <li><code>SSLv2</code>
522     <p>
523     This is the Secure Sockets Layer (SSL) protocol, version 2.0. It is the
524     original SSL protocol as designed by Netscape Corporation.</p></li>
525
526 <li><code>SSLv3</code>
527     <p>
528     This is the Secure Sockets Layer (SSL) protocol, version 3.0. It is the
529     successor to SSLv2 and the currently (as of February 1999) de-facto
530     standardized SSL protocol from Netscape Corporation. It's supported by
531     almost all popular browsers.</p></li>
532
533 <li><code>TLSv1</code>
534     <p>
535     This is the Transport Layer Security (TLS) protocol, version 1.0. It is the
536     successor to SSLv3 and currently (as of February 1999) still under
537     construction by the Internet Engineering Task Force (IETF). It's still
538     not supported by any popular browsers.</p></li>
539
540 <li><code>All</code>
541     <p>
542     This is a shortcut for ``<code>+SSLv2 +SSLv3 +TLSv1</code>'' and a
543     convinient way for enabling all protocols except one when used in
544     combination with the minus sign on a protocol as the example above 
545     shows.</p></li>
546 </ul>
547 <example><title>Example</title>
548 #   enable SSLv3 and TLSv1, but not SSLv2<br />
549 SSLProtocol all -SSLv2
550 </example>
551 </usage>
552 </directivesynopsis>
553
554 <directivesynopsis>
555 <name>SSLCipherSuite</name>
556 <description>Cipher Suite available for negotiation in SSL 
557 handshake</description>
558 <syntax>SSLCipherSuite <em>cipher-spec</em></syntax>
559 <default>SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP</default>
560 <contextlist><context>server config</context>
561 <context>virtual host</context>
562 <context>directory</context>
563 <context>.htaccess</context></contextlist>
564 <override>AuthConfig</override>
565
566 <usage>
567 <p>
568 This complex directive uses a colon-separated <em>cipher-spec</em> string
569 consisting of OpenSSL cipher specifications to configure the Cipher Suite the
570 client is permitted to negotiate in the SSL handshake phase. Notice that this
571 directive can be used both in per-server and per-directory context. In
572 per-server context it applies to the standard SSL handshake when a connection
573 is established. In per-directory context it forces a SSL renegotation with the
574 reconfigured Cipher Suite after the HTTP request was read but before the HTTP
575 response is sent.</p>
576 <p>
577 An SSL cipher specification in <em>cipher-spec</em> is composed of 4 major
578 attributes plus a few extra minor ones:</p>
579 <ul>
580 <li><em>Key Exchange Algorithm</em>:<br />
581     RSA or Diffie-Hellman variants.
582 </li>
583 <li><em>Authentication Algorithm</em>:<br />
584     RSA, Diffie-Hellman, DSS or none.
585 </li>
586 <li><em>Cipher/Encryption Algorithm</em>:<br />
587     DES, Triple-DES, RC4, RC2, IDEA or none.
588 </li>
589 <li><em>MAC Digest Algorithm</em>:<br />
590     MD5, SHA or SHA1.
591 </li>
592 </ul>
593 <p>An SSL cipher can also be an export cipher and is either a SSLv2 or SSLv3/TLSv1
594 cipher (here TLSv1 is equivalent to SSLv3). To specify which ciphers to use,
595 one can either specify all the Ciphers, one at a time, or use aliases to
596 specify the preference and order for the ciphers (see <a href="#table1">Table
597 1</a>).</p>
598
599 <table border="1">
600 <columnspec><column width=".5"/><column width=".5"/></columnspec>
601 <tr><th><a name="table1">Tag</a></th> <th>Description</th></tr>
602 <tr><td colspan="2"><em>Key Exchange Algorithm:</em></td></tr>
603 <tr><td><code>kRSA</code></td>   <td>RSA key exchange</td></tr>
604 <tr><td><code>kDHr</code></td>   <td>Diffie-Hellman key exchange with RSA key</td></tr>
605 <tr><td><code>kDHd</code></td>   <td>Diffie-Hellman key exchange with DSA key</td></tr>
606 <tr><td><code>kEDH</code></td>   <td>Ephemeral (temp.key) Diffie-Hellman key exchange (no cert)</td>   </tr>
607 <tr><td colspan="2"><em>Authentication Algorithm:</em></td></tr>
608 <tr><td><code>aNULL</code></td>  <td>No authentication</td></tr>
609 <tr><td><code>aRSA</code></td>   <td>RSA authentication</td></tr>
610 <tr><td><code>aDSS</code></td>   <td>DSS authentication</td> </tr>
611 <tr><td><code>aDH</code></td>    <td>Diffie-Hellman authentication</td></tr>
612 <tr><td colspan="2"><em>Cipher Encoding Algorithm:</em></td></tr>
613 <tr><td><code>eNULL</code></td>  <td>No encoding</td>         </tr>
614 <tr><td><code>DES</code></td>    <td>DES encoding</td>        </tr>
615 <tr><td><code>3DES</code></td>   <td>Triple-DES encoding</td> </tr>
616 <tr><td><code>RC4</code></td>    <td>RC4 encoding</td>       </tr>
617 <tr><td><code>RC2</code></td>    <td>RC2 encoding</td>       </tr>
618 <tr><td><code>IDEA</code></td>   <td>IDEA encoding</td>       </tr>
619 <tr><td colspan="2"><em>MAC Digest Algorithm</em>:</td></tr>
620 <tr><td><code>MD5</code></td>    <td>MD5 hash function</td></tr>
621 <tr><td><code>SHA1</code></td>   <td>SHA1 hash function</td></tr>
622 <tr><td><code>SHA</code></td>    <td>SHA hash function</td> </tr>
623 <tr><td colspan="2"><em>Aliases:</em></td></tr>
624 <tr><td><code>SSLv2</code></td>  <td>all SSL version 2.0 ciphers</td></tr>
625 <tr><td><code>SSLv3</code></td>  <td>all SSL version 3.0 ciphers</td> </tr>
626 <tr><td><code>TLSv1</code></td>  <td>all TLS version 1.0 ciphers</td> </tr>
627 <tr><td><code>EXP</code></td>    <td>all export ciphers</td>  </tr>
628 <tr><td><code>EXPORT40</code></td> <td>all 40-bit export ciphers only</td>  </tr>
629 <tr><td><code>EXPORT56</code></td> <td>all 56-bit export ciphers only</td>  </tr>
630 <tr><td><code>LOW</code></td>    <td>all low strength ciphers (no export, single DES)</td></tr>
631 <tr><td><code>MEDIUM</code></td> <td>all ciphers with 128 bit encryption</td> </tr>
632 <tr><td><code>HIGH</code></td>   <td>all ciphers using Triple-DES</td>     </tr>
633 <tr><td><code>RSA</code></td>    <td>all ciphers using RSA key exchange</td> </tr>
634 <tr><td><code>DH</code></td>     <td>all ciphers using Diffie-Hellman key exchange</td> </tr>
635 <tr><td><code>EDH</code></td>    <td>all ciphers using Ephemeral Diffie-Hellman key exchange</td> </tr>
636 <tr><td><code>ADH</code></td>    <td>all ciphers using Anonymous Diffie-Hellman key exchange</td> </tr>
637 <tr><td><code>DSS</code></td>    <td>all ciphers using DSS authentication</td> </tr>
638 <tr><td><code>NULL</code></td>   <td>all ciphers using no encryption</td> </tr>
639 </table>
640 <p>
641 Now where this becomes interesting is that these can be put together
642 to specify the order and ciphers you wish to use. To speed this up
643 there are also aliases (<code>SSLv2, SSLv3, TLSv1, EXP, LOW, MEDIUM,
644 HIGH</code>) for certain groups of ciphers. These tags can be joined
645 together with prefixes to form the <em>cipher-spec</em>. Available
646 prefixes are:</p>
647 <ul>
648 <li>none: add cipher to list</li>
649 <li><code>+</code>: add ciphers to list and pull them to current location in list</li>
650 <li><code>-</code>: remove cipher from list (can be added later again)</li>
651 <li><code>!</code>: kill cipher from list completely (can <strong>not</strong> be added later again)</li>
652 </ul>
653 <p>A simpler way to look at all of this is to use the ``<code>openssl ciphers
654 -v</code>'' command which provides a nice way to successively create the
655 correct <em>cipher-spec</em> string. The default <em>cipher-spec</em> string
656 is ``<code>ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP</code>'' which
657 means the following: first, remove from consideration any ciphers that do not
658 authenticate, i.e. for SSL only the Anonymous Diffie-Hellman ciphers. Next,
659 use ciphers using RC4 and RSA. Next include the high, medium and then the low
660 security ciphers. Finally <em>pull</em> all SSLv2 and export ciphers to the
661 end of the list.</p>
662 <example>
663 <pre>
664 $ openssl ciphers -v 'ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP'
665 NULL-SHA                SSLv3 Kx=RSA      Au=RSA  Enc=None      Mac=SHA1
666 NULL-MD5                SSLv3 Kx=RSA      Au=RSA  Enc=None      Mac=MD5
667 EDH-RSA-DES-CBC3-SHA    SSLv3 Kx=DH       Au=RSA  Enc=3DES(168) Mac=SHA1
668 ...                     ...               ...     ...           ...
669 EXP-RC4-MD5             SSLv3 Kx=RSA(512) Au=RSA  Enc=RC4(40)   Mac=MD5  export
670 EXP-RC2-CBC-MD5         SSLv2 Kx=RSA(512) Au=RSA  Enc=RC2(40)   Mac=MD5  export
671 EXP-RC4-MD5             SSLv2 Kx=RSA(512) Au=RSA  Enc=RC4(40)   Mac=MD5  export
672 </pre>
673 </example>
674 <p>The complete list of particular RSA &amp; DH ciphers for SSL is given in <a
675 href="#table2">Table 2</a>.</p>
676 <example><title>Example</title>
677 SSLCipherSuite RSA:!EXP:!NULL:+HIGH:+MEDIUM:-LOW
678 </example>
679 <table border="1">
680 <columnspec><column width=".3"/><column width=".1"/><column width=".13"/>
681 <column width=".1"/><column width=".13"/><column width=".1"/>
682 <column width=".13"/></columnspec>
683 <tr><th><a name="table2">Cipher-Tag</a></th> <th>Protocol</th> <th>Key Ex.</th> <th>Auth.</th> <th>Enc.</th> <th>MAC</th> <th>Type</th> </tr>
684 <tr><td colspan="7"><em>RSA Ciphers:</em></td></tr>
685 <tr><td><code>DES-CBC3-SHA</code></td> <td>SSLv3</td> <td>RSA</td> <td>RSA</td> <td>3DES(168)</td> <td>SHA1</td> <td></td> </tr>
686 <tr><td><code>DES-CBC3-MD5</code></td> <td>SSLv2</td> <td>RSA</td> <td>RSA</td> <td>3DES(168)</td> <td>MD5</td> <td></td> </tr>
687 <tr><td><code>IDEA-CBC-SHA</code></td> <td>SSLv3</td> <td>RSA</td> <td>RSA</td> <td>IDEA(128)</td> <td>SHA1</td> <td></td> </tr>
688 <tr><td><code>RC4-SHA</code></td> <td>SSLv3</td> <td>RSA</td> <td>RSA</td> <td>RC4(128)</td> <td>SHA1</td> <td></td> </tr>
689 <tr><td><code>RC4-MD5</code></td> <td>SSLv3</td> <td>RSA</td> <td>RSA</td> <td>RC4(128)</td> <td>MD5</td> <td></td> </tr>
690 <tr><td><code>IDEA-CBC-MD5</code></td> <td>SSLv2</td> <td>RSA</td> <td>RSA</td> <td>IDEA(128)</td> <td>MD5</td> <td></td> </tr>
691 <tr><td><code>RC2-CBC-MD5</code></td> <td>SSLv2</td> <td>RSA</td> <td>RSA</td> <td>RC2(128)</td> <td>MD5</td> <td></td> </tr>
692 <tr><td><code>RC4-MD5</code></td> <td>SSLv2</td> <td>RSA</td> <td>RSA</td> <td>RC4(128)</td> <td>MD5</td> <td></td> </tr>
693 <tr><td><code>DES-CBC-SHA</code></td> <td>SSLv3</td> <td>RSA</td> <td>RSA</td> <td>DES(56)</td> <td>SHA1</td> <td></td> </tr>
694 <tr><td><code>RC4-64-MD5</code></td> <td>SSLv2</td> <td>RSA</td> <td>RSA</td> <td>RC4(64)</td> <td>MD5</td> <td></td> </tr>
695 <tr><td><code>DES-CBC-MD5</code></td> <td>SSLv2</td> <td>RSA</td> <td>RSA</td> <td>DES(56)</td> <td>MD5</td> <td></td> </tr>
696 <tr><td><code>EXP-DES-CBC-SHA</code></td> <td>SSLv3</td> <td>RSA(512)</td> <td>RSA</td> <td>DES(40)</td> <td>SHA1</td> <td> export</td> </tr>
697 <tr><td><code>EXP-RC2-CBC-MD5</code></td> <td>SSLv3</td> <td>RSA(512)</td> <td>RSA</td> <td>RC2(40)</td> <td>MD5</td> <td>  export</td> </tr>
698 <tr><td><code>EXP-RC4-MD5</code></td> <td>SSLv3</td> <td>RSA(512)</td> <td>RSA</td> <td>RC4(40)</td> <td>MD5</td> <td>  export</td> </tr>
699 <tr><td><code>EXP-RC2-CBC-MD5</code></td> <td>SSLv2</td> <td>RSA(512)</td> <td>RSA</td> <td>RC2(40)</td> <td>MD5</td> <td>  export</td> </tr>
700 <tr><td><code>EXP-RC4-MD5</code></td> <td>SSLv2</td> <td>RSA(512)</td> <td>RSA</td> <td>RC4(40)</td> <td>MD5</td> <td>  export</td> </tr>
701 <tr><td><code>NULL-SHA</code></td> <td>SSLv3</td> <td>RSA</td> <td>RSA</td> <td>None</td> <td>SHA1</td> <td></td> </tr>
702 <tr><td><code>NULL-MD5</code></td> <td>SSLv3</td> <td>RSA</td> <td>RSA</td> <td>None</td> <td>MD5</td> <td></td> </tr>
703 <tr><td colspan="7"><em>Diffie-Hellman Ciphers:</em></td></tr>
704 <tr><td><code>ADH-DES-CBC3-SHA</code></td> <td>SSLv3</td> <td>DH</td> <td>None</td> <td>3DES(168)</td> <td>SHA1</td> <td></td> </tr>
705 <tr><td><code>ADH-DES-CBC-SHA</code></td> <td>SSLv3</td> <td>DH</td> <td>None</td> <td>DES(56)</td> <td>SHA1</td> <td></td> </tr>
706 <tr><td><code>ADH-RC4-MD5</code></td> <td>SSLv3</td> <td>DH</td> <td>None</td> <td>RC4(128)</td> <td>MD5</td> <td></td> </tr>
707 <tr><td><code>EDH-RSA-DES-CBC3-SHA</code></td> <td>SSLv3</td> <td>DH</td> <td>RSA</td> <td>3DES(168)</td> <td>SHA1</td> <td></td> </tr>
708 <tr><td><code>EDH-DSS-DES-CBC3-SHA</code></td> <td>SSLv3</td> <td>DH</td> <td>DSS</td> <td>3DES(168)</td> <td>SHA1</td> <td></td> </tr>
709 <tr><td><code>EDH-RSA-DES-CBC-SHA</code></td> <td>SSLv3</td> <td>DH</td> <td>RSA</td> <td>DES(56)</td> <td>SHA1</td> <td></td> </tr>
710 <tr><td><code>EDH-DSS-DES-CBC-SHA</code></td> <td>SSLv3</td> <td>DH</td> <td>DSS</td> <td>DES(56)</td> <td>SHA1</td> <td></td> </tr>
711 <tr><td><code>EXP-EDH-RSA-DES-CBC-SHA</code></td> <td>SSLv3</td> <td>DH(512)</td> <td>RSA</td> <td>DES(40)</td> <td>SHA1</td> <td> export</td> </tr>
712 <tr><td><code>EXP-EDH-DSS-DES-CBC-SHA</code></td> <td>SSLv3</td> <td>DH(512)</td> <td>DSS</td> <td>DES(40)</td> <td>SHA1</td> <td> export</td> </tr>
713 <tr><td><code>EXP-ADH-DES-CBC-SHA</code></td> <td>SSLv3</td> <td>DH(512)</td> <td>None</td> <td>DES(40)</td> <td>SHA1</td> <td> export</td> </tr>
714 <tr><td><code>EXP-ADH-RC4-MD5</code></td> <td>SSLv3</td> <td>DH(512)</td> <td>None</td> <td>RC4(40)</td> <td>MD5</td> <td>  export</td> </tr>
715 </table>
716 </usage>
717 </directivesynopsis>
718
719 <directivesynopsis>
720 <name>SSLCertificateFile</name>
721 <description>Server PEM-encoded X.509 Certificate file</description>
722 <syntax>SSLCertificateFile <em>file-path</em></syntax>
723 <contextlist><context>server config</context>
724 <context>virtual host</context></contextlist>
725
726 <usage>
727 <p>
728 This directive points to the PEM-encoded Certificate file for the server and
729 optionally also to the corresponding RSA or DSA Private Key file for it
730 (contained in the same file). If the contained Private Key is encrypted the
731 Pass Phrase dialog is forced at startup time. This directive can be used up to
732 two times (referencing different filenames) when both a RSA and a DSA based
733 server certificate is used in parallel.</p>
734 <example><title>Example</title>
735 SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt
736 </example>
737 </usage>
738 </directivesynopsis>
739
740 <directivesynopsis>
741 <name>SSLCertificateKeyFile</name>
742 <description>Server PEM-encoded Private Key file</description>
743 <syntax>SSLCertificateKeyFile <em>file-path</em></syntax>
744 <contextlist><context>server config</context>
745 <context>virtual host</context></contextlist>
746
747 <usage>
748 <p>
749 This directive points to the PEM-encoded Private Key file for the
750 server. If the Private Key is not combined with the Certificate in the
751 <directive>SSLCertificateFile</directive>, use this additional directive to
752 point to the file with the stand-alone Private Key. When
753 <directive>SSLCertificateFile</directive> is used and the file
754 contains both the Certificate and the Private Key this directive need
755 not be used. But we strongly discourage this practice.  Instead we
756 recommend you to separate the Certificate and the Private Key. If the
757 contained Private Key is encrypted, the Pass Phrase dialog is forced
758 at startup time. This directive can be used up to two times
759 (referencing different filenames) when both a RSA and a DSA based
760 private key is used in parallel.</p>
761 <example><title>Example</title>
762 SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server.key
763 </example>
764 </usage>
765 </directivesynopsis>
766
767 <directivesynopsis>
768 <name>SSLCertificateChainFile</name>
769 <description>File of PEM-encoded Server CA Certificates</description>
770 <syntax>SSLCertificateChainFile <em>file-path</em></syntax>
771 <contextlist><context>server config</context>
772 <context>virtual host</context></contextlist>
773
774 <usage>
775 <p>
776 This directive sets the optional <em>all-in-one</em> file where you can
777 assemble the certificates of Certification Authorities (CA) which form the
778 certificate chain of the server certificate. This starts with the issuing CA
779 certificate of of the server certificate and can range up to the root CA
780 certificate. Such a file is simply the concatenation of the various
781 PEM-encoded CA Certificate files, usually in certificate chain order.</p>
782 <p>
783 This should be used alternatively and/or additionally to <directive
784 module="mod_ssl">SSLCACertificatePath</directive> for explicitly
785 constructing the server certificate chain which is sent to the browser
786 in addition to the server certificate. It is especially useful to
787 avoid conflicts with CA certificates when using client
788 authentication. Because although placing a CA certificate of the
789 server certificate chain into <directive
790 module="mod_ssl">SSLCACertificatePath</directive> has the same effect
791 for the certificate chain construction, it has the side-effect that
792 client certificates issued by this same CA certificate are also
793 accepted on client authentication. That's usually not one expect.</p>
794 <p>
795 But be careful: Providing the certificate chain works only if you are using a
796 <em>single</em> (either RSA <em>or</em> DSA) based server certificate. If you are
797 using a coupled RSA+DSA certificate pair, this will work only if actually both
798 certificates use the <em>same</em> certificate chain. Else the browsers will be
799 confused in this situation.</p>
800 <example><title>Example</title>
801 SSLCertificateChainFile /usr/local/apache2/conf/ssl.crt/ca.crt
802 </example>
803 </usage>
804 </directivesynopsis>
805
806 <directivesynopsis>
807 <name>SSLCACertificatePath</name>
808 <description>Directory of PEM-encoded CA Certificates for 
809 Client Auth</description>
810 <syntax>SSLCACertificatePath <em>directory-path</em></syntax>
811 <contextlist><context>server config</context>
812 <context>virtual host</context></contextlist>
813
814 <usage>
815 <p>
816 This directive sets the directory where you keep the Certificates of
817 Certification Authorities (CAs) whose clients you deal with. These are used to
818 verify the client certificate on Client Authentication.</p>
819 <p>
820 The files in this directory have to be PEM-encoded and are accessed through
821 hash filenames. So usually you can't just place the Certificate files
822 there: you also have to create symbolic links named
823 <em>hash-value</em><code>.N</code>. And you should always make sure this directory
824 contains the appropriate symbolic links. Use the <code>Makefile</code> which
825 comes with mod_ssl to accomplish this task.</p>
826 <example><title>Example</title>
827 SSLCACertificatePath /usr/local/apache2/conf/ssl.crt/
828 </example>
829 </usage>
830 </directivesynopsis>
831
832 <directivesynopsis>
833 <name>SSLCACertificateFile</name>
834 <description>File of concatenated PEM-encoded CA Certificates 
835 for Client Auth</description>
836 <syntax>SSLCACertificateFile <em>file-path</em></syntax>
837 <contextlist><context>server config</context>
838 <context>virtual host</context></contextlist>
839
840 <usage>
841 <p>
842 This directive sets the <em>all-in-one</em> file where you can assemble the
843 Certificates of Certification Authorities (CA) whose <em>clients</em> you deal
844 with. These are used for Client Authentication. Such a file is simply the
845 concatenation of the various PEM-encoded Certificate files, in order of
846 preference. This can be used alternatively and/or additionally to 
847 <directive module="mod_ssl">SSLCACertificatePath</directive>.</p>
848 <example><title>Example</title>
849 SSLCACertificateFile /usr/local/apache2/conf/ssl.crt/ca-bundle-client.crt
850 </example>
851 </usage>
852 </directivesynopsis>
853
854 <directivesynopsis>
855 <name>SSLCADNRequestFile</name>
856 <description>File of concatenated PEM-encoded CA Certificates 
857 for defining acceptable CA names</description>
858 <syntax>SSLCADNRequestFile <em>file-path</em></syntax>
859 <contextlist><context>server config</context>
860 <context>virtual host</context></contextlist>
861
862 <usage>
863 <p>When a client certificate is requested by mod_ssl, a list of
864 <em>acceptable Certificate Authority names</em> is sent to the client
865 in the SSL handshake.  These CA names can be used by the client to
866 select an appropriate client certificate out of those it has
867 available.</p>
868
869 <p>If neither of the directives <directive
870 module="mod_ssl">SSLCADNRequestPath</directive> or <directive
871 module="mod_ssl">SSLCADNRequestFile</directive> are given, then the
872 set of acceptable CA names sent to the client is the names of all the
873 CA certificates given by the <directive
874 module="mod_ssl">SSLCACertificateFile</directive> and <directive
875 module="mod_ssl">SSLCACertificatePath</directive> directives; in other
876 words, the names of the CAs which will actually be used to verify the
877 client certificate.</p>
878
879 <p>In some circumstances, it is useful to be able to send a set of
880 acceptable CA names which differs from the actual CAs used to verify
881 the client certificate - for example, if the client certificates are
882 signed by intermediate CAs.  In such cases, <directive
883 module="mod_ssl">SSLCADNRequestPath</directive> and/or <directive
884 module="mod_ssl">SSLCADNRequestFile</directive> can be used; the
885 acceptable CA names are then taken from the complete set of
886 certificates in the directory and/or file specified by this pair of
887 directives.</p>
888
889 <p><directive module="mod_ssl">SSLCADNRequestFile</directive> must
890 specify an <em>all-in-one</em> file containing a concatenation of
891 PEM-encoded CA certificates.</p>
892
893 <example><title>Example</title>
894 SSLCADNRequestFile /usr/local/apache2/conf/ca-names.crt
895 </example>
896 </usage>
897 </directivesynopsis>
898
899 <directivesynopsis>
900 <name>SSLCADNRequestPath</name>
901 <description>Directory of PEM-encoded CA Certificates for 
902 defining acceptable CA names</description>
903 <syntax>SSLCADNRequestPath <em>directory-path</em></syntax>
904 <contextlist><context>server config</context>
905 <context>virtual host</context></contextlist>
906
907 <usage>
908
909 <p>This optional directive can be used to specify the set of
910 <em>acceptable CA names</em> which will be sent to the client when a
911 client certificate is requested.  See the <directive
912 module="mod_ssl">SSLCADNRequestFile</directive> directive for more
913 details.</p>
914
915 <p>The files in this directory have to be PEM-encoded and are accessed
916 through hash filenames. So usually you can't just place the
917 Certificate files there: you also have to create symbolic links named
918 <em>hash-value</em><code>.N</code>. And you should always make sure
919 this directory contains the appropriate symbolic links. Use the
920 <code>Makefile</code> which comes with mod_ssl to accomplish this
921 task.</p>
922 <example><title>Example</title>
923 SSLCADNRequestPath /usr/local/apache2/conf/ca-names.crt/
924 </example>
925 </usage>
926 </directivesynopsis>
927
928 <directivesynopsis>
929 <name>SSLCARevocationPath</name>
930 <description>Directory of PEM-encoded CA CRLs for 
931 Client Auth</description>
932 <syntax>SSLCARevocationPath <em>directory-path</em></syntax>
933 <contextlist><context>server config</context>
934 <context>virtual host</context></contextlist>
935
936 <usage>
937 <p>
938 This directive sets the directory where you keep the Certificate Revocation
939 Lists (CRL) of Certification Authorities (CAs) whose clients you deal with.
940 These are used to revoke the client certificate on Client Authentication.</p>
941 <p>
942 The files in this directory have to be PEM-encoded and are accessed through
943 hash filenames. So usually you have not only to place the CRL files there.
944 Additionally you have to create symbolic links named
945 <em>hash-value</em><code>.rN</code>. And you should always make sure this directory
946 contains the appropriate symbolic links. Use the <code>Makefile</code> which
947 comes with <module>mod_ssl</module> to accomplish this task.</p>
948 <example><title>Example</title>
949 SSLCARevocationPath /usr/local/apache2/conf/ssl.crl/
950 </example>
951 </usage>
952 </directivesynopsis>
953
954 <directivesynopsis>
955 <name>SSLCARevocationFile</name>
956 <description>File of concatenated PEM-encoded CA CRLs for 
957 Client Auth</description>
958 <syntax>SSLCARevocationFile <em>file-path</em></syntax>
959 <contextlist><context>server config</context>
960 <context>virtual host</context></contextlist>
961
962 <usage>
963 <p>
964 This directive sets the <em>all-in-one</em> file where you can
965 assemble the Certificate Revocation Lists (CRL) of Certification
966 Authorities (CA) whose <em>clients</em> you deal with. These are used
967 for Client Authentication.  Such a file is simply the concatenation of
968 the various PEM-encoded CRL files, in order of preference. This can be
969 used alternatively and/or additionally to <directive
970 module="mod_ssl">SSLCARevocationPath</directive>.</p>
971 <example><title>Example</title>
972 SSLCARevocationFile /usr/local/apache2/conf/ssl.crl/ca-bundle-client.crl
973 </example>
974 </usage>
975 </directivesynopsis>
976
977 <directivesynopsis>
978 <name>SSLVerifyClient</name>
979 <description>Type of Client Certificate verification</description>
980 <syntax>SSLVerifyClient <em>level</em></syntax>
981 <default>SSLVerifyClient none</default>
982 <contextlist><context>server config</context>
983 <context>virtual host</context>
984 <context>directory</context>
985 <context>.htaccess</context></contextlist>
986 <override>AuthConfig</override>
987
988 <usage>
989 <p>
990 This directive sets the Certificate verification level for the Client
991 Authentication. Notice that this directive can be used both in per-server and
992 per-directory context. In per-server context it applies to the client
993 authentication process used in the standard SSL handshake when a connection is
994 established. In per-directory context it forces a SSL renegotation with the
995 reconfigured client verification level after the HTTP request was read but
996 before the HTTP response is sent.</p>
997 <p>
998 The following levels are available for <em>level</em>:</p>
999 <ul>
1000 <li><strong>none</strong>:
1001      no client Certificate is required at all</li>
1002 <li><strong>optional</strong>:
1003      the client <em>may</em> present a valid Certificate</li>
1004 <li><strong>require</strong>:
1005      the client <em>has to</em> present a valid Certificate</li>
1006 <li><strong>optional_no_ca</strong>:
1007      the client may present a valid Certificate<br />
1008      but it need not to be (successfully) verifiable.</li>
1009 </ul>
1010 <p>In practice only levels <strong>none</strong> and
1011 <strong>require</strong> are really interesting, because level
1012 <strong>optional</strong> doesn't work with all browsers and level
1013 <strong>optional_no_ca</strong> is actually against the idea of
1014 authentication (but can be used to establish SSL test pages, etc.)</p>
1015 <example><title>Example</title>
1016 SSLVerifyClient require
1017 </example>
1018 </usage>
1019 </directivesynopsis>
1020
1021 <directivesynopsis>
1022 <name>SSLVerifyDepth</name>
1023 <description>Maximum depth of CA Certificates in Client 
1024 Certificate verification</description>
1025 <syntax>SSLVerifyDepth <em>number</em></syntax>
1026 <default>SSLVerifyDepth 1</default>
1027 <contextlist><context>server config</context>
1028 <context>virtual host</context>
1029 <context>directory</context>
1030 <context>.htaccess</context></contextlist>
1031 <override>AuthConfig</override>
1032
1033 <usage>
1034 <p>
1035 This directive sets how deeply mod_ssl should verify before deciding that the
1036 clients don't have a valid certificate. Notice that this directive can be
1037 used both in per-server and per-directory context. In per-server context it
1038 applies to the client authentication process used in the standard SSL
1039 handshake when a connection is established. In per-directory context it forces
1040 a SSL renegotation with the reconfigured client verification depth after the
1041 HTTP request was read but before the HTTP response is sent.</p>
1042 <p>
1043 The depth actually is the maximum number of intermediate certificate issuers,
1044 i.e. the number of CA certificates which are max allowed to be followed while
1045 verifying the client certificate. A depth of 0 means that self-signed client
1046 certificates are accepted only, the default depth of 1 means the client
1047 certificate can be self-signed or has to be signed by a CA which is directly
1048 known to the server (i.e. the CA's certificate is under
1049 <directive module="mod_ssl">SSLCACertificatePath</directive>), etc.</p>
1050 <example><title>Example</title>
1051 SSLVerifyDepth 10
1052 </example>
1053 </usage>
1054 </directivesynopsis>
1055
1056 <directivesynopsis>
1057 <name>SSLOptions</name>
1058 <description>Configure various SSL engine run-time options</description>
1059 <syntax>SSLOptions [+|-]<em>option</em> ...</syntax>
1060 <contextlist><context>server config</context>
1061 <context>virtual host</context>
1062 <context>directory</context>
1063 <context>.htaccess</context></contextlist>
1064 <override>Options</override>
1065
1066 <usage>
1067 <p>
1068 This directive can be used to control various run-time options on a
1069 per-directory basis. Normally, if multiple <code>SSLOptions</code>
1070 could apply to a directory, then the most specific one is taken
1071 completely; the options are not merged. However if <em>all</em> the
1072 options on the <code>SSLOptions</code> directive are preceded by a
1073 plus (<code>+</code>) or minus (<code>-</code>) symbol, the options
1074 are merged. Any options preceded by a <code>+</code> are added to the
1075 options currently in force, and any options preceded by a
1076 <code>-</code> are removed from the options currently in force.</p>
1077 <p>
1078 The available <em>option</em>s are:</p>
1079 <ul>
1080 <li><code>StdEnvVars</code>
1081     <p>
1082     When this option is enabled, the standard set of SSL related CGI/SSI
1083     environment variables are created. This per default is disabled for
1084     performance reasons, because the information extraction step is a
1085     rather expensive operation. So one usually enables this option for
1086     CGI and SSI requests only.</p>
1087 </li>
1088 <li><code>CompatEnvVars</code>
1089     <p>
1090     When this option is enabled, additional CGI/SSI environment variables are
1091     created for backward compatibility to other Apache SSL solutions. Look in
1092     the <a href="../ssl/ssl_compat.html">Compatibility</a> chapter for details
1093     on the particular variables generated.</p>
1094 </li>
1095 <li><code>ExportCertData</code>
1096     <p>
1097     When this option is enabled, additional CGI/SSI environment variables are
1098     created: <code>SSL_SERVER_CERT</code>, <code>SSL_CLIENT_CERT</code> and
1099     <code>SSL_CLIENT_CERT_CHAIN_</code><em>n</em> (with <em>n</em> = 0,1,2,..).
1100     These contain the PEM-encoded X.509 Certificates of server and client for
1101     the current HTTPS connection and can be used by CGI scripts for deeper
1102     Certificate checking. Additionally all other certificates of the client
1103     certificate chain are provided, too. This bloats up the environment a
1104     little bit which is why you have to use this option to enable it on
1105     demand.</p>
1106 </li>
1107 <li><code>FakeBasicAuth</code>
1108     <p>
1109     When this option is enabled, the Subject Distinguished Name (DN) of the
1110     Client X509 Certificate is translated into a HTTP Basic Authorization
1111     username. This means that the standard Apache authentication methods can
1112     be used for access control. The user name is just the Subject of the
1113     Client's X509 Certificate (can be determined by running OpenSSL's
1114     <code>openssl x509</code> command: <code>openssl x509 -noout -subject -in
1115     </code><em>certificate</em><code>.crt</code>). Note that no password is
1116     obtained from the user. Every entry in the user file needs this password:
1117     ``<code>xxj31ZMTZzkVA</code>'', which is the DES-encrypted version of the
1118     word `<code>password</code>''. Those who live under MD5-based encryption
1119     (for instance under FreeBSD or BSD/OS, etc.) should use the following MD5
1120     hash of the same word: ``<code>$1$OXLyS...$Owx8s2/m9/gfkcRVXzgoE/</code>''.</p>
1121 </li>
1122 <li><code>StrictRequire</code>
1123     <p>
1124     This <em>forces</em> forbidden access when <code>SSLRequireSSL</code> or
1125     <code>SSLRequire</code> successfully decided that access should be
1126     forbidden. Usually the default is that in the case where a ``<code>Satisfy
1127     any</code>'' directive is used, and other access restrictions are passed,
1128     denial of access due to <code>SSLRequireSSL</code> or
1129     <code>SSLRequire</code> is overridden (because that's how the Apache
1130     <code>Satisfy</code> mechanism should work.) But for strict access restriction
1131     you can use <code>SSLRequireSSL</code> and/or <code>SSLRequire</code> in
1132     combination with an ``<code>SSLOptions +StrictRequire</code>''. Then an
1133     additional ``<code>Satisfy Any</code>'' has no chance once mod_ssl has
1134     decided to deny access.</p>
1135 </li>
1136 <li><code>OptRenegotiate</code>
1137     <p>
1138     This enables optimized SSL connection renegotiation handling when SSL
1139     directives are used in per-directory context. By default a strict
1140     scheme is enabled where <em>every</em> per-directory reconfiguration of
1141     SSL parameters causes a <em>full</em> SSL renegotiation handshake. When this
1142     option is used mod_ssl tries to avoid unnecessary handshakes by doing more
1143     granular (but still safe) parameter checks. Nevertheless these granular
1144     checks sometimes maybe not what the user expects, so enable this on a
1145     per-directory basis only, please.</p>
1146 </li>
1147 </ul>
1148 <example><title>Example</title>
1149 SSLOptions +FakeBasicAuth -StrictRequire<br />
1150 &lt;Files ~ "\.(cgi|shtml)$"&gt;<br />
1151     SSLOptions +StdEnvVars +CompatEnvVars -ExportCertData<br />
1152 &lt;Files&gt;
1153 </example>
1154 </usage>
1155 </directivesynopsis>
1156
1157 <directivesynopsis>
1158 <name>SSLRequireSSL</name>
1159 <description>Deny access when SSL is not used for the 
1160 HTTP request</description>
1161 <syntax>SSLRequireSSL</syntax>
1162 <contextlist><context>directory</context>
1163 <context>.htaccess</context></contextlist>
1164 <override>AuthConfig</override>
1165
1166 <usage>
1167 <p><!-- XXX: I think the syntax is wrong -->
1168 This directive forbids access unless HTTP over SSL (i.e. HTTPS) is enabled for
1169 the current connection. This is very handy inside the SSL-enabled virtual
1170 host or directories for defending against configuration errors that expose
1171 stuff that should be protected. When this directive is present all requests
1172 are denied which are not using SSL.</p>
1173 <example><title>Example</title>
1174 SSLRequireSSL
1175 </example>
1176 </usage>
1177 </directivesynopsis>
1178
1179 <directivesynopsis>
1180 <name>SSLRequire</name>
1181 <description>Allow access only when an arbitrarily complex 
1182 boolean expression is true</description>
1183 <syntax>SSLRequire <em>expression</em></syntax>
1184 <contextlist><context>directory</context>
1185 <context>.htaccess</context></contextlist>
1186 <override>AuthConfig</override>
1187
1188 <usage>
1189 <p>
1190 This directive specifies a general access requirement which has to be
1191 fulfilled in order to allow access. It is a very powerful directive because the
1192 requirement specification is an arbitrarily complex boolean expression
1193 containing any number of access checks.</p>
1194 <note type="warning">
1195 <p>The implementation of <code>SSLRequire</code> is not thread safe.  
1196    Using <code>SSLRequire</code> inside <code>.htaccess</code> files
1197    on a threaded <a href="../mpm.html">MPM</a> may cause random crashes.
1198 </p>
1199 </note>
1200 <p>
1201 The <em>expression</em> must match the following syntax (given as a BNF
1202 grammar notation):</p>
1203 <blockquote>
1204 <pre>
1205 expr     ::= "<strong>true</strong>" | "<strong>false</strong>"
1206            | "<strong>!</strong>" expr
1207            | expr "<strong>&amp;&amp;</strong>" expr
1208            | expr "<strong>||</strong>" expr
1209            | "<strong>(</strong>" expr "<strong>)</strong>"
1210            | comp
1211
1212 comp     ::= word "<strong>==</strong>" word | word "<strong>eq</strong>" word
1213            | word "<strong>!=</strong>" word | word "<strong>ne</strong>" word
1214            | word "<strong>&lt;</strong>"  word | word "<strong>lt</strong>" word
1215            | word "<strong>&lt;=</strong>" word | word "<strong>le</strong>" word
1216            | word "<strong>&gt;</strong>"  word | word "<strong>gt</strong>" word
1217            | word "<strong>&gt;=</strong>" word | word "<strong>ge</strong>" word
1218            | word "<strong>in</strong>" "<strong>{</strong>" wordlist "<strong>}</strong>"
1219            | word "<strong>in</strong>" "<strong>PeerExtList(</strong>" word "<strong>)</strong>"
1220            | word "<strong>=~</strong>" regex
1221            | word "<strong>!~</strong>" regex
1222
1223 wordlist ::= word
1224            | wordlist "<strong>,</strong>" word
1225
1226 word     ::= digit
1227            | cstring
1228            | variable
1229            | function
1230
1231 digit    ::= [0-9]+
1232 cstring  ::= "..."
1233 variable ::= "<strong>%{</strong>" varname "<strong>}</strong>"
1234 function ::= funcname "<strong>(</strong>" funcargs "<strong>)</strong>"
1235 </pre>
1236 </blockquote>
1237 <p>while for <code>varname</code> any variable from <a
1238 href="#table3">Table 3</a> can be used. Finally for
1239 <code>funcname</code> the following functions are available:</p>
1240 <ul>
1241 <li><code>file(</code><em>filename</em><code>)</code>
1242     <p>
1243     This function takes one string argument and expands to the contents of the
1244     file. This is especially useful for matching this contents against a
1245     regular expression, etc.</p>
1246 </li>
1247 </ul>
1248 <p>Notice that <em>expression</em> is first parsed into an internal machine
1249 representation and then evaluated in a second step. Actually, in Global and
1250 Per-Server Class context <em>expression</em> is parsed at startup time and
1251 at runtime only the machine representation is executed. For Per-Directory
1252 context this is different: here <em>expression</em> has to be parsed and
1253 immediately executed for every request.</p>
1254 <example><title>Example</title>
1255 SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)-/ \<br />
1256             and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \<br />
1257             and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \<br />
1258             and %{TIME_WDAY} &gt;= 1 and %{TIME_WDAY} &lt;= 5 \<br />
1259             and %{TIME_HOUR} &gt;= 8 and %{TIME_HOUR} &lt;= 20       ) \<br />
1260            or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
1261 </example>
1262 <p>The <code>PeerExtList(<em>object id</em>)</code> function expects to find
1263 zero or more instances of the X.509 Certificate Extension (as identified by
1264 the given <em>object id</em>) in the client certificate, and compares the
1265 left-hand side string against the value of any matching attribute value. Every
1266 extension with the specified object id is checked, until a match is found.
1267 </p>
1268
1269 <p><em>Standard CGI/1.0 and Apache variables:</em></p>
1270 <pre>
1271 HTTP_USER_AGENT        PATH_INFO             AUTH_TYPE
1272 HTTP_REFERER           QUERY_STRING          SERVER_SOFTWARE
1273 HTTP_COOKIE            REMOTE_HOST           API_VERSION
1274 HTTP_FORWARDED         REMOTE_IDENT          TIME_YEAR
1275 HTTP_HOST              IS_SUBREQ             TIME_MON
1276 HTTP_PROXY_CONNECTION  DOCUMENT_ROOT         TIME_DAY
1277 HTTP_ACCEPT            SERVER_ADMIN          TIME_HOUR
1278 HTTP:headername        SERVER_NAME           TIME_MIN
1279 THE_REQUEST            SERVER_PORT           TIME_SEC
1280 REQUEST_METHOD         SERVER_PROTOCOL       TIME_WDAY
1281 REQUEST_SCHEME         REMOTE_ADDR           TIME
1282 REQUEST_URI            REMOTE_USER           ENV:<strong>variablename</strong>
1283 REQUEST_FILENAME
1284 </pre>
1285 <p><em>SSL-related variables:</em></p>
1286 <pre>
1287 HTTPS                  SSL_CLIENT_M_VERSION   SSL_SERVER_M_VERSION
1288                        SSL_CLIENT_M_SERIAL    SSL_SERVER_M_SERIAL
1289 SSL_PROTOCOL           SSL_CLIENT_V_START     SSL_SERVER_V_START
1290 SSL_SESSION_ID         SSL_CLIENT_V_END       SSL_SERVER_V_END
1291 SSL_CIPHER             SSL_CLIENT_S_DN        SSL_SERVER_S_DN
1292 SSL_CIPHER_EXPORT      SSL_CLIENT_S_DN_C      SSL_SERVER_S_DN_C
1293 SSL_CIPHER_ALGKEYSIZE  SSL_CLIENT_S_DN_ST     SSL_SERVER_S_DN_ST
1294 SSL_CIPHER_USEKEYSIZE  SSL_CLIENT_S_DN_L      SSL_SERVER_S_DN_L
1295 SSL_VERSION_LIBRARY    SSL_CLIENT_S_DN_O      SSL_SERVER_S_DN_O
1296 SSL_VERSION_INTERFACE  SSL_CLIENT_S_DN_OU     SSL_SERVER_S_DN_OU
1297                        SSL_CLIENT_S_DN_CN     SSL_SERVER_S_DN_CN
1298                        SSL_CLIENT_S_DN_T      SSL_SERVER_S_DN_T
1299                        SSL_CLIENT_S_DN_I      SSL_SERVER_S_DN_I
1300                        SSL_CLIENT_S_DN_G      SSL_SERVER_S_DN_G
1301                        SSL_CLIENT_S_DN_S      SSL_SERVER_S_DN_S
1302                        SSL_CLIENT_S_DN_D      SSL_SERVER_S_DN_D
1303                        SSL_CLIENT_S_DN_UID    SSL_SERVER_S_DN_UID
1304                        SSL_CLIENT_S_DN_Email  SSL_SERVER_S_DN_Email
1305                        SSL_CLIENT_I_DN        SSL_SERVER_I_DN
1306                        SSL_CLIENT_I_DN_C      SSL_SERVER_I_DN_C
1307                        SSL_CLIENT_I_DN_ST     SSL_SERVER_I_DN_ST
1308                        SSL_CLIENT_I_DN_L      SSL_SERVER_I_DN_L
1309                        SSL_CLIENT_I_DN_O      SSL_SERVER_I_DN_O
1310                        SSL_CLIENT_I_DN_OU     SSL_SERVER_I_DN_OU
1311                        SSL_CLIENT_I_DN_CN     SSL_SERVER_I_DN_CN
1312                        SSL_CLIENT_I_DN_T      SSL_SERVER_I_DN_T
1313                        SSL_CLIENT_I_DN_I      SSL_SERVER_I_DN_I
1314                        SSL_CLIENT_I_DN_G      SSL_SERVER_I_DN_G
1315                        SSL_CLIENT_I_DN_S      SSL_SERVER_I_DN_S
1316                        SSL_CLIENT_I_DN_D      SSL_SERVER_I_DN_D
1317                        SSL_CLIENT_I_DN_UID    SSL_SERVER_I_DN_UID
1318                        SSL_CLIENT_I_DN_Email  SSL_SERVER_I_DN_Email
1319                        SSL_CLIENT_A_SIG       SSL_SERVER_A_SIG
1320                        SSL_CLIENT_A_KEY       SSL_SERVER_A_KEY
1321                        SSL_CLIENT_CERT        SSL_SERVER_CERT
1322                        SSL_CLIENT_CERT_CHAIN_<strong>n</strong>
1323                        SSL_CLIENT_VERIFY
1324 </pre>
1325 </usage>
1326 </directivesynopsis>
1327
1328 <directivesynopsis>
1329 <name>SSLProxyMachineCertificatePath</name>
1330 <description>Directory of PEM-encoded client certificates and keys to be used by the proxy</description>
1331 <syntax>SSLProxyMachineCertificatePath <em>directory</em></syntax>
1332 <contextlist><context>server config</context></contextlist>
1333 <override>Not applicable</override>
1334
1335 <usage>
1336 <p>
1337 This directive sets the directory where you keep the certificates and
1338 keys used for authentication of the proxy server to remote servers.
1339 </p>
1340 <p>The files in this directory must be PEM-encoded and are accessed through
1341 hash filenames. Additionally, you must create symbolic links named
1342 <code><em>hash-value</em>.N</code>. And you should always make sure this
1343 directory contains the appropriate symbolic links. Use the Makefile which
1344 comes with mod_ssl to accomplish this task.
1345 </p>
1346 <note type="warning">
1347 <p>Currently there is no support for encrypted private keys</p>
1348 </note>
1349 <example><title>Example</title>
1350 SSLProxyMachineCertificatePath /usr/local/apache2/conf/proxy.crt/
1351 </example> 
1352 </usage> 
1353 </directivesynopsis>
1354
1355
1356 <directivesynopsis>
1357 <name>SSLProxyMachineCertificateFile</name>
1358 <description>File of concatenated PEM-encoded client certificates and keys to be used by the proxy</description>
1359 <syntax>SSLProxyMachineCertificateFile <em>filename</em></syntax>
1360 <contextlist><context>server config</context></contextlist>
1361 <override>Not applicable</override>
1362
1363 <usage>
1364 <p>
1365 This directive sets the all-in-one file where you keep the certificates and
1366 keys used for authentication of the proxy server to remote servers.
1367 </p>
1368 <p>
1369 This referenced file is simply the concatenation of the various PEM-encoded
1370 certificate files, in order of preference. Use this directive alternatively
1371 or additionally to <code>SSLProxyMachineCertificatePath</code>.
1372 </p>
1373 <note type="warning">
1374 <p>Currently there is no support for encrypted private keys</p>
1375 </note>
1376 <example><title>Example</title>
1377 SSLProxyMachineCertificateFile /usr/local/apache2/conf/ssl.crt/proxy.pem
1378 </example>
1379 </usage>
1380 </directivesynopsis>
1381
1382 <directivesynopsis>
1383 <name>SSLProxyVerify</name>
1384 <description>Type of remote server Certificate verification</description>
1385 <syntax>SSLProxyVerify <em>level</em></syntax>
1386 <default>SSLProxyVerify none</default>
1387 <contextlist><context>server config</context>
1388 <context>virtual host</context>
1389 <context>directory</context>
1390 <context>.htaccess</context></contextlist>
1391 <override>AuthConfig</override>
1392
1393 <usage>
1394
1395 <p>When a proxy is configured to forward requests to a remote SSL
1396 server, this directive can be used to configure certificate
1397 verification of the remote server.  Notice that this directive can be
1398 used both in per-server and per-directory context. In per-server
1399 context it applies to the remote server authentication process used in
1400 the standard SSL handshake when a connection is established by the
1401 proxy. In per-directory context it forces a SSL renegotation with the
1402 reconfigured remote server verification level after the HTTP request
1403 was read but before the HTTP response is sent.</p>
1404
1405 <note type="warning">
1406 <p>Note that even when certificate verification is enabled,
1407 <module>mod_ssl</module> does <strong>not</strong> check whether the
1408 <code>commonName</code> (hostname) attribute of the server certificate
1409 matches the hostname used to connect to the server.  In other words,
1410 the proxy does not guarantee that the SSL connection to the backend
1411 server is "secure" beyond the fact that the certificate is signed by
1412 one of the CAs configured using the
1413 <directive>SSLProxyCACertificatePath</directive> and/or
1414 <directive>SSLProxyCACertificateFile</directive> directives.</p>
1415 </note>
1416
1417 <p>
1418 The following levels are available for <em>level</em>:</p>
1419 <ul>
1420 <li><strong>none</strong>:
1421      no remote server Certificate is required at all</li>
1422 <li><strong>optional</strong>:
1423      the remote server <em>may</em> present a valid Certificate</li>
1424 <li><strong>require</strong>:
1425      the remote server <em>has to</em> present a valid Certificate</li>
1426 <li><strong>optional_no_ca</strong>:
1427      the remote server may present a valid Certificate<br />
1428      but it need not to be (successfully) verifiable.</li>
1429 </ul>
1430 <p>In practice only levels <strong>none</strong> and
1431 <strong>require</strong> are really interesting, because level
1432 <strong>optional</strong> doesn't work with all servers and level
1433 <strong>optional_no_ca</strong> is actually against the idea of
1434 authentication (but can be used to establish SSL test pages, etc.)</p>
1435 <example><title>Example</title>
1436 SSLProxyVerify require
1437 </example>
1438 </usage>
1439 </directivesynopsis>
1440
1441 <directivesynopsis>
1442 <name>SSLProxyVerifyDepth</name>
1443 <description>Maximum depth of CA Certificates in Remote Server
1444 Certificate verification</description>
1445 <syntax>SSLProxyVerifyDepth <em>number</em></syntax>
1446 <default>SSLProxyVerifyDepth 1</default>
1447 <contextlist><context>server config</context>
1448 <context>virtual host</context>
1449 <context>directory</context>
1450 <context>.htaccess</context></contextlist>
1451 <override>AuthConfig</override>
1452
1453 <usage>
1454 <p>
1455 This directive sets how deeply mod_ssl should verify before deciding that the
1456 remote server does not have a valid certificate. Notice that this directive can be
1457 used both in per-server and per-directory context. In per-server context it
1458 applies to the client authentication process used in the standard SSL
1459 handshake when a connection is established. In per-directory context it forces
1460 a SSL renegotation with the reconfigured remote server verification depth after the
1461 HTTP request was read but before the HTTP response is sent.</p>
1462 <p>
1463 The depth actually is the maximum number of intermediate certificate issuers,
1464 i.e. the number of CA certificates which are max allowed to be followed while
1465 verifying the remote server certificate. A depth of 0 means that self-signed
1466 remote server certificates are accepted only, the default depth of 1 means
1467 the remote server certificate can be self-signed or has to be signed by a CA
1468 which is directly known to the server (i.e. the CA's certificate is under
1469 <directive module="mod_ssl">SSLProxyCACertificatePath</directive>), etc.</p>
1470 <example><title>Example</title>
1471 SSLProxyVerifyDepth 10
1472 </example>
1473 </usage>
1474 </directivesynopsis>
1475
1476 <directivesynopsis>
1477 <name>SSLProxyEngine</name>
1478 <description>SSL Proxy Engine Operation Switch</description>
1479 <syntax>SSLProxyEngine on|off</syntax>
1480 <default>SSLProxyEngine off</default>
1481 <contextlist><context>server config</context>
1482 <context>virtual host</context></contextlist>
1483
1484 <usage>
1485 <p>
1486 This directive toggles the usage of the SSL/TLS Protocol Engine for proxy. This
1487 is usually used inside a <directive module="core"
1488 type="section">VirtualHost</directive> section to enable SSL/TLS for proxy
1489 usage in a particular virtual host. By default the SSL/TLS Protocol Engine is
1490 disabled for proxy image both for the main server and all configured virtual hosts.</p>
1491 <example><title>Example</title>
1492 &lt;VirtualHost _default_:443&gt;<br />
1493 SSLProxyEngine on<br />
1494 ...<br />
1495 &lt;/VirtualHost&gt;
1496 </example>
1497 </usage>
1498 </directivesynopsis>
1499
1500 <directivesynopsis>
1501 <name>SSLProxyProtocol</name>
1502 <description>Configure usable SSL protocol flavors for proxy usage</description>
1503 <syntax>SSLProxyProtocol [+|-]<em>protocol</em> ...</syntax>
1504 <default>SSLProxyProtocol all</default>
1505 <contextlist><context>server config</context>
1506 <context>virtual host</context></contextlist>
1507 <override>Options</override>
1508
1509 <usage>
1510 <!-- XXX Why does this have an override and not .htaccess context? -->
1511 <p>
1512 This directive can be used to control the SSL protocol flavors mod_ssl should
1513 use when establishing its server environment for proxy . It will only connect
1514 to servers using one of the provided protocols.</p>
1515 <p>Please refer to <directive module="mod_ssl">SSLProtocol</directive>
1516 for additional information.
1517 </p>
1518 </usage>
1519 </directivesynopsis>
1520
1521 <directivesynopsis>
1522 <name>SSLProxyCipherSuite</name>
1523 <description>Cipher Suite available for negotiation in SSL 
1524 proxy handshake</description>
1525 <syntax>SSLProxyCipherSuite <em>cipher-spec</em></syntax>
1526 <default>SSLProxyCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP</default>
1527 <contextlist><context>server config</context>
1528 <context>virtual host</context>
1529 <context>directory</context>
1530 <context>.htaccess</context></contextlist>
1531 <override>AuthConfig</override>
1532 <usage>
1533 <p>Equivalent to <code>SSLCipherSuite</code>, but for the proxy connection.
1534 Please refer to <directive module="mod_ssl">SSLCipherSuite</directive>
1535 for additional information.</p>
1536 </usage>
1537
1538 </directivesynopsis>
1539 <directivesynopsis>
1540 <name>SSLProxyCACertificatePath</name>
1541 <description>Directory of PEM-encoded CA Certificates for 
1542 Remote Server Auth</description>
1543 <syntax>SSLProxyCACertificatePath <em>directory-path</em></syntax>
1544 <contextlist><context>server config</context>
1545 <context>virtual host</context></contextlist>
1546
1547 <usage>
1548 <p>
1549 This directive sets the directory where you keep the Certificates of
1550 Certification Authorities (CAs) whose remote servers you deal with. These are used to
1551 verify the remote server certificate on Remote Server Authentication.</p>
1552 <p>
1553 The files in this directory have to be PEM-encoded and are accessed through
1554 hash filenames. So usually you can't just place the Certificate files
1555 there: you also have to create symbolic links named
1556 <em>hash-value</em><code>.N</code>. And you should always make sure this directory
1557 contains the appropriate symbolic links. Use the <code>Makefile</code> which
1558 comes with mod_ssl to accomplish this task.</p>
1559 <example><title>Example</title>
1560 SSLProxyCACertificatePath /usr/local/apache2/conf/ssl.crt/
1561 </example>
1562 </usage>
1563 </directivesynopsis>
1564
1565 <directivesynopsis>
1566 <name>SSLProxyCACertificateFile</name>
1567 <description>File of concatenated PEM-encoded CA Certificates 
1568 for Remote Server Auth</description>
1569 <syntax>SSLProxyCACertificateFile <em>file-path</em></syntax>
1570 <contextlist><context>server config</context>
1571 <context>virtual host</context></contextlist>
1572
1573 <usage>
1574 <p>
1575 This directive sets the <em>all-in-one</em> file where you can assemble the
1576 Certificates of Certification Authorities (CA) whose <em>remote servers</em> you deal
1577 with. These are used for Remote Server Authentication. Such a file is simply the
1578 concatenation of the various PEM-encoded Certificate files, in order of
1579 preference. This can be used alternatively and/or additionally to 
1580 <directive module="mod_ssl">SSLProxyCACertificatePath</directive>.</p>
1581 <example><title>Example</title>
1582 SSLProxyCACertificateFile /usr/local/apache2/conf/ssl.crt/ca-bundle-remote-server.crt
1583 </example>
1584 </usage>
1585 </directivesynopsis>
1586
1587 <directivesynopsis>
1588 <name>SSLProxyCARevocationPath</name>
1589 <description>Directory of PEM-encoded CA CRLs for 
1590 Remote Server Auth</description>
1591 <syntax>SSLProxyCARevocationPath <em>directory-path</em></syntax>
1592 <contextlist><context>server config</context>
1593 <context>virtual host</context></contextlist>
1594
1595 <usage>
1596 <p>
1597 This directive sets the directory where you keep the Certificate Revocation
1598 Lists (CRL) of Certification Authorities (CAs) whose remote servers you deal with.
1599 These are used to revoke the remote server certificate on Remote Server Authentication.</p>
1600 <p>
1601 The files in this directory have to be PEM-encoded and are accessed through
1602 hash filenames. So usually you have not only to place the CRL files there.
1603 Additionally you have to create symbolic links named
1604 <em>hash-value</em><code>.rN</code>. And you should always make sure this directory
1605 contains the appropriate symbolic links. Use the <code>Makefile</code> which
1606 comes with <module>mod_ssl</module> to accomplish this task.</p>
1607 <example><title>Example</title>
1608 SSLProxyCARevocationPath /usr/local/apache2/conf/ssl.crl/
1609 </example>
1610 </usage>
1611 </directivesynopsis>
1612
1613 <directivesynopsis>
1614 <name>SSLProxyCARevocationFile</name>
1615 <description>File of concatenated PEM-encoded CA CRLs for 
1616 Remote Server Auth</description>
1617 <syntax>SSLProxyCARevocationFile <em>file-path</em></syntax>
1618 <contextlist><context>server config</context>
1619 <context>virtual host</context></contextlist>
1620
1621 <usage>
1622 <p>
1623 This directive sets the <em>all-in-one</em> file where you can
1624 assemble the Certificate Revocation Lists (CRL) of Certification
1625 Authorities (CA) whose <em>remote servers</em> you deal with. These are used
1626 for Remote Server Authentication.  Such a file is simply the concatenation of
1627 the various PEM-encoded CRL files, in order of preference. This can be
1628 used alternatively and/or additionally to <directive
1629 module="mod_ssl">SSLProxyCARevocationPath</directive>.</p>
1630 <example><title>Example</title>
1631 SSLProxyCARevocationFile /usr/local/apache2/conf/ssl.crl/ca-bundle-remote-server.crl
1632 </example>
1633 </usage>
1634 </directivesynopsis>
1635
1636 <directivesynopsis>
1637 <name>SSLUserName</name>
1638 <description>Variable name to determine user name</description>
1639 <syntax>SSLUserName <em>varname</em></syntax>
1640 <contextlist><context>server config</context>
1641 <context>directory</context>
1642 <context>.htaccess</context></contextlist>
1643 <override>AuthConfig</override>
1644 <compatibility>Available in Apache 2.0.51 and later</compatibility>
1645
1646 <usage>
1647 <p>
1648 This directive sets the "user" field in the Apache request object.
1649 This is used by lower modules to identify the user with a character
1650 string. In particular, this may cause the environment variable
1651 <code>REMOTE_USER</code> to be set.  The <em>varname</em> can be
1652 any of the <a href="#envvars">SSL environment variables</a>.</p>
1653
1654 <p>Note that this directive has no effect if the
1655 <code>FakeBasic</code> option is used (see <a
1656 href="#ssloptions">SSLOptions</a>).</p>
1657
1658 <example><title>Example</title>
1659 SSLUserName SSL_CLIENT_S_DN_CN
1660 </example>
1661 </usage>
1662 </directivesynopsis>
1663
1664 <directivesynopsis>
1665 <name>SSLHonorCipherOrder</name>
1666 <description>Option to prefer the server's cipher preference order</description>
1667 <syntax>SSLHonorCiperOrder <em>flag</em></syntax>
1668 <contextlist><context>server config</context>
1669 <context>virtual host</context></contextlist>
1670 <compatibility>Available in Apache 2.1 and later, if using OpenSSL 0.9.7 or later</compatibility>
1671
1672 <usage>
1673 <p>When choosing a cipher during an SSLv3 or TLSv1 handshake, normally
1674 the client's preference is used.  If this directive is enabled, the
1675 server's preference will be used instead.</p>
1676 <example><title>Example</title>
1677 SSLHonorCipherOrder on
1678 </example>
1679 </usage>
1680 </directivesynopsis>
1681
1682 <directivesynopsis>
1683 <name>SSLCryptoDevice</name>
1684 <description>Enable use of a cryptographic hardware accelerator</description>
1685 <syntax>SSLCryptoDevice <em>engine</em></syntax>
1686 <default>SSLCryptoDevice builtin</default>
1687 <contextlist><context>server config</context></contextlist>
1688 <compatibility>Available if mod_ssl is built using <code>-DSSL_ENGINE_EXPERIMENTAL</code></compatibility>
1689
1690 <usage>
1691 <p>
1692 This directive enables use of a cryptographic hardware accelerator
1693 board to offload some of the SSL processing overhead.  This directive
1694 can only be used if the SSL toolkit is built with "engine" support;
1695 OpenSSL 0.9.7 and later releases have "engine" support by default, the
1696 separate "-engine" releases of OpenSSL 0.9.6 must be used.</p>
1697
1698 <p>To discover which engine names are supported, run the command
1699 &quot;<code>openssl engine</code>&quot;.</p>
1700
1701 <example><title>Example</title>
1702 # For a Broadcom accelerator:<br />
1703 SSLCryptoDevice ubsec
1704 </example>
1705 </usage>
1706 </directivesynopsis>
1707
1708 </modulesynopsis>