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