source: mod_gnutls/docs/mod_gnutls_manual-0.1.html @ 369f47a

debian/masterdebian/stretch-backportsjessie-backportsmsvaupstream
Last change on this file since 369f47a was 369f47a, checked in by Daniel Kahn Gillmor <dkg@…>, 7 years ago

avoid calling gnutls_srp_server_get_username() unless SRP is configured

  • Property mode set to 100644
File size: 32.5 KB
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3    <head>
4        <title>mod_gnutls Manual 0.1</title>
5        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
6        <style type="text/css" media="all">
7        h1{text-align:center;}
8        p{margin-left:2%;}
9        code{color:#000000;background-color:cyan;}
10        h4{text-align:center;color:#000000;background-color:cyan;width:100%;}
11        .directive{margin-left:5%;margin-right:5%;border:#000000 solid 1px;}
12        h5{display:inline;margin-right:10%;}
13        .warn{color:inherit;background-color:#FF0000}
14        h6{margin-left:2%;font-weight:bold;display:inline;}
15        </style>
16    </head>
17    <body>
18        <h1>mod_gnutls Manual 0.1<br /><small>July 2011</small></h1>
19        <hr />
20        <div id="Contents">
21            <h2>Contents</h2>
22            <ol>
23                <li>Compilation & Installation</li>
24                <li>Integration</li>
25                <li>Configuration Directives<br />
26                    <ul>
27                        <li>GnuTLSCache</li>
28                        <li>GnuTLSCacheTimeout</li>
29                        <li>GnuTLSSessionTickets</li>
30                        <li>GnuTLSCertificateFile</li>
31                        <li>GnuTLSKeyFile</li>
32                        <li>GnuTLSPGPCertificateFile</li>
33                        <li>GnuTLSPGPKeyFile</li>
34                        <li>GnuTLSClientVerify</li>
35                        <li>GnuTLSClientCAFile</li>
36                        <li>GnuTLSPGPKeyringFile</li>
37                        <li>GnuTLSEnable</li>
38                        <li>GnuTLSDHFile</li>
39                        <li>GnuTLSRSAFile</li>
40                        <li>GnuTLSSRPPasswdFile</li>
41                        <li>GnuTLSSRPPasswdConfFile</li>
42                        <li>GnuTLSPriorities</li>
43                        <li>GnuTLSExportCertificates</li>
44                    </ul>
45                </li>
46                <li>Configuration Examples<br />
47                    <ul>
48                        <li>Simple Standard SSL Example</li>
49                        <li>Server Name Indication Example</li>
50                    </ul>
51                </li>
52                <li>Performance Issues</li>
53                <li>Environment Variables</li>
54                <li>Credits</li>
55            </ol>
56        </div>
57        <hr />
58        <div id="Installation">
59            <h2>Compilation &amp; Installation</h2>
60            <p>mod_gnutls uses the "configure/make/make install" mechanism common to many Open Source programs.<br />
61            Most of the dirty work is handled by either configure or Apache's apxs utility.<br />
62            If you have built Apache modules before, there shouldn't be any surprises for you.<br />
63            The interesting options you can pass to configure are:<br />
64            <br />
65            --with-apxs=PATH<br />
66            This option is used to specify the location of the apxs utility that was installed as part of apache.<br />
67            Specify the location of the binary, not the directory it is located in.<br />
68            <br />
69            --with-libgnutls=PATH<br />
70            Full path to the libgnutls-config program.<br />
71            <br />
72            --with-apr-memcache=PREFIX<br />
73            Prefix to where apr_memcache is installed.<br />
74            <br />
75            --help<br />
76            Provides a list of all available configure options.</p>
77        </div>
78        <hr />
79        <div id="Integration">
80            <h2>Integration</h2>
81            <p>To activate mod_gnutls just add the following line to your httpd.conf and restart Apache:</p>
82            <p><code>LoadModule gnutls_module modules/mod_gnutls.so</code></p>
83        </div>
84        <hr />
85        <div id="Configuration">
86            <h2>Configuration Directives:</h2>
87            <h4>GnuTLSCache</h4>
88            <div class="directive">
89                <h5>Description:</h5>Configure SSL Session Cache<br />
90                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
91                GnuTLSCache [<i>dbm</i>|<i>gdbm</i>|<i>memcache</i>|<i>none</i>] [path|server list|-]<br />
92                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
93                GnuTLSCache gdbm "conf/gnutls_cache"<br />
94                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
95                global config<br />
96            </div>
97            <p>This directive configures the SSL Session Cache for mod_gnutls.<br />
98               This could be shared between machines of different architectures.</p>
99            <p>
100               <b>dbm (Requires Berkeley DBM)</b><br />
101               Uses the default Berkeley DB backend of APR DBM to cache SSL Sessions results.<br />
102               The argument is a relative or absolute path to be used as the DBM Cache file.<br />
103               This is compatible with most operating systems, but needs the Apache Runtime to be compiled with Berkeley DBM support.<br />
104               <b>gdbm</b><br />
105               Uses the GDBM backend of APR DBM to cache SSL Sessions results.<br />
106               The argument is a relative or absolute path to be used as the DBM Cache file.<br />
107               This is the default and recommended option.<br />
108               <b>memcache</b><br />
109               Uses a memcached server to cache the SSL Session.<br />
110               The argument is a space separated list of servers. If no port number is supplied, the default of 11211 is used.<br />
111               This can be used to share a session cache between all servers in a cluster.<br />
112               <b>none</b><br />
113               Turns off all caching of SSL Sessions.<br />
114               This can significantly reduce the performance of mod_gnutls since even followup connections by a client must renegotiate parameters instead of reusing old ones.<br />
115            </p>
116            <h4>GnuTLSCacheTimeout</h4>
117            <div class="directive">
118                <h5>Description:</h5>Timeout for SSL Session Cache expiration<br />
119                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
120                GnuTLSCacheTimeout <i>seconds</i><br />
121                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
122                GnuTLSCacheTimeout 300<br />
123                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
124                global config<br />
125            </div>   
126            <p>Sets the timeout for SSL Session Cache entries expiration.<br />
127            This directive is valid even if Session Tickets are used, and indicates the expiration time of the ticket in seconds.</p>
128            <h4>GnuTLSSessionTickets</h4>
129            <div class="directive">
130                <h5>Description:</h5>Enable Session Tickets for the server<br />
131                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
132                GnuTLSSessionTickets [ <i>on</i> | <i>off</i> ]<br />
133                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
134                <i>off</i><br />
135                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
136                server config, virtual host<br />
137            </div> 
138            <p>To avoid storing data for TLS session resumption it is allowed to provide client with a ticket, to use on return.<br />
139            Use for servers with limited storage, and don't combine with GnuTLSCache.<br />
140            For a pool of servers this option is not recommended since the tickets are unique for the issuing server only.</p>
141            <h4>GnuTLSCertificateFile</h4>
142            <div class="directive">
143                <h5>Description:</h5>Set to the PEM Encoded Server Certificate<br />
144                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
145                GnuTLSCertificateFile <i>file-path</i><br />
146                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
147                <i>none</i><br />
148                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
149                server config, virtual host<br />
150            </div>       
151            <p>Takes an absolute or relative path to a PEM-encoded
152            X.509 certificate to use as this Server's End Entity (EE)
153            certificate. If you need to supply certificates for
154            intermediate Certificate Authorities (iCAs), they should
155            be listed in sequence in the file, from EE to the iCA
156            closest to the root CA.  Optionally, you can also include
157            the root CA's certificate as the last certificate in the
158            list.</p>
159            <h4>GnuTLSKeyFile</h4>
160            <div class="directive">
161                <h5>Description:</h5>Set to the PEM Encoded Server Certificate<br />
162                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
163                GnuTLSCertificateFile <i>file-path</i><br />
164                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
165                <i>none</i><br />
166                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
167                server config, virtual host<br />
168            </div> 
169            <p>Takes an absolute or relative path to the Server Private Key.<br />
170            This key cannot currently be password protected.</p>
171            <p class="warn">
172                <b>Security Warning:</b><br />
173                This private key must be protected. It is read while Apache is still running as root, and does not need to be readable by the nobody or apache user.
174            </p>
175            <h4>GnuTLSPGPCertificateFile</h4>
176            <div class="directive">
177                <h5>Description:</h5>Set to a base64 Encoded Server OpenPGP Certificate<br />
178                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
179                GnuTLSPGPCertificateFile <i>file-path</i><br />
180                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
181                <i>none</i><br />
182                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
183                server config, virtual host<br />
184            </div>
185            <p>Takes an absolute or relative path to a base64 Encoded OpenPGP Certificate to use as this Server's Certificate.</p>
186            <h4>GnuTLSPGPKeyFile</h4>
187            <div class="directive">
188                <h5>Description:</h5>Set to the Server OpenPGP Secret Key<br />
189                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
190                GnuTLSPGPKeyFile <i>file-path</i><br />
191                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
192                <i>none</i><br />
193                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
194                server config, virtual host<br />
195            </div>
196            <p>Takes an absolute or relative path to the Server Private Key. This key cannot currently be password protected.</p>
197            <p class="warn">
198                <b>Security Warning:</b><br />
199                This private key must be protected. It is read while Apache is still running as root, and does not need to be readable by the nobody or apache user.
200            </p>           
201            <h4>GnuTLSClientVerify</h4>
202            <div class="directive">
203                <h5>Description:</h5>Enable Client Certificate Verification<br />
204                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
205                GnuTLSClientVerify [ <i>ignore</i> | <i>request</i> | <i>require</i> ]<br />
206                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
207                <i>ignore</i><br />
208                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
209                server config, virtual host, directory, .htaccess<br />
210            </div>
211            <p>This directive controls the use of SSL Client Certificate Authentication.<br />
212            If used in the .htaccess context, it can force TLS re-negotiation.</p>
213            <p>
214                <b>ignore</b><br />
215                mod_gnutls will ignore the contents of any SSL Client Certificates sent.<br />
216                It will not request that the client sends a certificate.<br />
217                <b>request</b><br />
218                The client certificate will be requested, but not required.<br />
219                The Certificate will be validated if sent.<br />
220                The output of the validation status will be stored in the SSL_CLIENT_VERIFY environment variable and can be "SUCCESS", "FAILED" or "NONE".<br />
221                <b>require</b><br />
222                A Client certificate will be required. Any requests without a valid client certificate will be denied.<br />
223                The SSL_CLIENT_VERIFY environment variable will only be set to "SUCCESS".
224            </p>
225            <h4>GnuTLSClientCAFile</h4>
226            <div class="directive">
227                <h5>Description:</h5>Set to the PEM Encoded Certificate Authority Certificate<br />
228                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
229                GnuTLSClientCAFile <i>file-path</i><br />
230                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
231                <i>none</i><br />
232                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
233                server config, virtual host<br />
234            </div>
235            <p>
236               Takes an absolute or relative path to a PEM Encoded Certificate to use as a Certificate Authority with Client Certificate Authentication.<br />
237               This file may contain a list of trusted authorities.<br />
238            </p>
239            <h4>GnuTLSPGPKeyringFile</h4>
240            <div class="directive">
241                <h5>Description:</h5>Set to a base64 Encoded key ring<br />
242                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
243                GnuTLSPGPKeyringFile <i>file-path</i><br />
244                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
245                <i>none</i><br />
246                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
247                server config, virtual host<br />
248            </div>
249            <p>Takes an absolute or relative path to a base64 Encoded Certificate list (key ring) to use as a means of verification of Client Certificates.<br />
250               This file should contain a list of trusted signers.</p>
251            <h4>GnuTLSEnable</h4>
252            <div class="directive">
253                <h5>Description:</h5>Enable GnuTLS for this virtual host<br />
254                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
255                GnuTLSEnable [ <i>on</i> | <i>off</i> ] <br />
256                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
257                <i>off</i><br />
258                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
259                virtual host<br />
260            </div>
261            <p>This directive enables SSL/TLS Encryption for a Virtual Host.</p>
262            <h4>GnuTLSDHFile</h4>
263            <div class="directive">
264                <h5>Description:</h5>Set to the PKCS #3 encoded Diffie Hellman parameters<br />
265                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
266                GnuTLSDHFile <i>file-path</i> <br />
267                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
268                <i>none</i><br />
269                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
270                server config, virtual host<br />
271            </div>
272            <p>Takes an absolute or relative path to a PKCS #3 encoded DH parameters.<br />
273            Those are used when the DHE key exchange method is enabled.<br />
274            You can generate this file using "certtool --generate-dh-params --bits 2048".<br />
275            If not set mod_gnutls will use the included parameters.</p>
276            <h4>GnuTLSSRPPasswdFile</h4>
277            <div class="directive">
278                <h5>Description:</h5>Set to the SRP password file for SRP ciphersuites<br />
279                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
280                GnuTLSSRPPasswdFile <i>file-path</i> <br />
281                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
282                <i>none</i><br />
283                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
284                server config, virtual host<br />
285            </div>
286            <p>Takes an absolute or relative path to an SRP password file.  This is the same format as used in libsrp.<br />
287            You can generate such file using the command "srptool --passwd /etc/tpasswd --passwd-conf /etc/tpasswd.conf -u test" to set a password for user test.<br />
288            This password file holds the username, a password verifier and the dependency to the SRP parameters.</p>
289            <h4>GnuTLSSRPPasswdConfFile</h4>
290            <div class="directive">
291                <h5>Description:</h5>Set to the SRP password.conf file for SRP ciphersuites<br />
292                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
293                GnuTLSSRPPasswdConfFile <i>file-path</i> <br />
294                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
295                <i>none</i><br />
296                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
297                server config, virtual host<br />
298            </div>
299            <p>Takes an absolute or relative path to an SRP password.conf file.  This is the same format as used in libsrp.<br />
300            You can generate such file using the command "srptool --create-conf /etc/tpasswd.conf".<br />
301            This file holds the SRP parameters and is associate with the password file (the verifiers depends on these parameters).</p>
302            <h4>GnuTLSPriorities</h4>
303            <div class="directive">
304                <h5>Description:</h5>Set the allowed ciphers, key exchange algorithms, MACs and compression methods<br />
305                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
306                GnuTLSPriorities <i>+cipher0:+cipher1:...:+cipherN</i><br />
307                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
308                <i>none</i><br />
309                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
310                server config, virtual host<br />
311            </div>
312            <p>
313            Takes a semi-colon separated list of ciphers, key exchange methods<br />
314            Message authentication codes and compression methods to enable.<br />
315            The allowed keywords are specified in the gnutls_priority_init() function of GnuTLS.<br />
316            It's documentation can be found at <a href="http://www.gnu.org/software/gnutls/manual/html_node/Core-functions.html#Core-functions">Core GnuTLS functions</a>.<br />
317            In brief you can specify a set of ciphersuites from the choices:<br />
318            <ul>
319                <li><b>NONE</b>: The empty list.</li>
320                <li><b>EXPORT</b>: A list with all the supported cipher combinations including the "EXPORT" strength algorithms.</li>
321                <li><b>PERFORMANCE</b>: A list with all the secure cipher combinations sorted in terms of performance.</li>
322                <li><b>NORMAL</b>: A list with all the secure cipher combinations sorted with respect to security margin (subjective term).</li>
323                <li><b>SECURE</b>: A list with all the secure cipher combinations including the 256-bit ciphers sorted with respect to security margin.</li>
324            </ul>
325            </p>
326            <p>
327            Additionally you can add or remove algorithms using the "+" and "!" prefixes respectively.<br />
328            That is in order to disable the ARCFOUR cipher from the "NORMAL" set you can use the string <b>NORMAL</b>:!ARCFOUR-128<br />
329            Other options such as the protocol version and the compression method can be specified using the <b>VERS-</b> and <b>COMP-</b> prefixes.<br />
330            So in order to remove or add a specific TLS version from the "NORMAL" set use <b>NORMAL:!VERS-SSL3.0</b>.<br />
331            To enable zlib compression use <b>NORMAL:+COMP-DEFLATE</b>.<br />
332            However it is recommended not to add compression at this level.<br />
333            With the "NONE" set, in order to be usable, you have to specify a complete set of combinations of protocol versions,<br />
334            cipher algorithms (<b>AES-128-CBC</b>), key exchange algorithms (<b>RSA</b>), message authentication codes (<b>SHA1</b>) and compression methods (<b>COMP-NULL</b>).<br />
335            <br />
336            All the supported algorithms are:<br />
337            <ul>
338                <li><b>Ciphers</b>: AES-256-CBC, AES-128-CBC, CAMELLIA-256-CBC, CAMELLIA-128-CBC, ARCFOUR-128, 3DES-CBC, ARCFOUR-40</li>
339                <li><b>Key exchange methods</b>: RSA, DHE-RSA, DHE-DSS, SRP, SRP-RSA, SRP-DSS, ANON-DH</li>
340                <li><b>Message authentication codes</b>: SHA1, MD5</li>
341                <li><b>Compression methods</b>: COMP-DEFLATE, COMP-NULL</li>
342                <li><b>Protocol versions</b>: VERS-TLS1.1, VERS-TLS1.0, VERS-SSL3.0</li>
343            </ul>
344            </p>
345            <p>The special keyword "%COMPAT" will disable some security features such as protection against statistical attacks to ciphertext data in order to achieve maximum compatibility (some broken mobile clients need this).</p>
346            <h4>GnuTLSExportCertificates</h4>
347            <div class="directive">
348                <h5>Description:</h5>Export the PEM encoded certificates to CGIs<br />
349                <h5>Syntax:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
350                GnuTLSExportCertificates [ <i>on</i> | <i>off</i> ]<br />
351                <h5>Default:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
352                <i>off</i><br />
353                <h5>Context:</h5>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
354                server config, virtual host<br />
355            </div>
356            <p>This directive enables exporting the full PEM encoded certificates of the server and the client to CGIs.<br />
357            This makes mod_gnutls export exactly the same environment variables as mod_ssl.</p>
358        </div>
359        <hr />
360        <div id="Examples">
361            <h2>Configuration Examples</h2>
362            <h4>Simple Standard SSL Example:</h4>
363            <p>The following is an example of standard SSL Hosting, using one IP Addresses for each virtual host</p>
364            <p>
365            <code>
366            # Load the module into Apache.<br />
367            LoadModule gnutls_module modules/mod_gnutls.so<br />
368            GnuTLSCache gdbm /var/cache/www-tls-cache<br />
369            GnuTLSCacheTimeout 500<br />
370            # With normal SSL Websites, you need one IP Address per-site.<br />
371            Listen 1.2.3.1:443<br />
372            Listen 1.2.3.2:443<br />
373            Listen 1.2.3.3:443<br />
374            Listen 1.2.3.4:443<br />
375            &lt;VirtualHost 1.2.3.1:443&gt;<br />
376            GnuTLSEnable on<br />
377            GnuTLSPriorities NONE:+AES-128-CBC:+3DES-CBC:+ARCFOUR-128:+RSA:+DHE-RSA:+DHE-DSS:+SHA1:+MD5:+COMP-NULL<br />
378            DocumentRoot /www/site1.example.com/html<br />
379            ServerName site1.example.com:443<br />
380            GnuTLSCertificateFile conf/ssl/site1.crt<br />
381            GnuTLSKeyFile conf/ss/site1.key<br />
382            &lt;/VirtualHost&gt;<br />
383            &lt;VirtualHost 1.2.3.2:443&gt;<br />
384            # This virtual host enables SRP authentication<br />
385            GnuTLSEnable on<br />
386            GnuTLSPriorities NORMAL:+SRP<br />
387            DocumentRoot /www/site2.example.com/html<br />
388            ServerName site2.example.com:443<br />
389            GnuTLSSRPPasswdFile conf/ssl/tpasswd.site2<br />
390            GnuTLSSRPPasswdConfFile conf/ssl/tpasswd.site2.conf<br />
391            &lt;/VirtualHost&gt;<br />
392            &lt;VirtualHost 1.2.3.3:443&gt;<br />
393            # This server enables SRP, OpenPGP and X.509 authentication.<br />
394            GnuTLSEnable on<br />
395            GnuTLSPriorities NORMAL:+SRP:+SRP-RSA:+SRP-DSS<br />
396            DocumentRoot /www/site3.example.com/html<br />
397            ServerName site3.example.com:443<br />
398            GnuTLSCertificateFile conf/ssl/site3.crt<br />
399            GnuTLSKeyFile conf/ss/site3.key<br />
400            GnuTLSClientVerify ignore<br />
401            GnuTLSPGPCertificateFile conf/ss/site3.pub.asc<br />
402            GnuTLSPGPKeyFile conf/ss/site3.sec.asc<br />
403            GnuTLSSRPPasswdFile conf/ssl/tpasswd.site3<br />
404            GnuTLSSRPPasswdConfFile conf/ssl/tpasswd.site3.conf<br />
405            &lt;/VirtualHost&gt;<br />
406            &lt;VirtualHost 1.2.3.4:443&gt;<br />
407            GnuTLSEnable on<br />
408            # %COMPAT disables some security features to enable maximum compatibility with clients.<br />
409            GnuTLSPriorities NONE:+AES-128-CBC:+ARCFOUR-128:+RSA:+SHA1:+MD5:+COMP-NULL:%COMPAT<br />
410            DocumentRoot /www/site4.example.com/html<br />
411            ServerName site4.example.com:443<br />
412            GnuTLSCertificateFile conf/ssl/site4.crt<br />
413            GnuTLSKeyFile conf/ss/site4.key<br />
414            &lt;/VirtualHost&gt;<br />
415            </code>
416            </p>
417            <h4>Server Name Indication Example:</h4>
418            <p>
419            mod_gnutls can also use 'Server Name Indication', as specified in RFC 3546.<br />
420            This allows hosting many SSL Websites, with a Single IP Address.<br />
421            Currently all the recent browsers support this standard.<br />
422            Here is an example, using SNI:<br />
423            <code>
424            <p>
425            # Load the module into Apache.<br />
426            LoadModule gnutls_module modules/mod_gnutls.so<br />
427            # With normal SSL Websites, you need one IP Address per-site.<br />
428            Listen 1.2.3.1:443<br />
429            # This could also be 'Listen *:443',<br />
430            # just like '*:80' is common for non-https<br />
431            # No caching. Enable session tickets. Timeout is still used for<br />
432            # ticket expiration.<br />
433            GnuTLSCacheTimeout 600<br />
434            # This tells apache, that for this IP/Port combination, we want to use<br />
435            # Name Based Virtual Hosting. In the case of Server Name Indication,<br />
436            # it lets mod_gnutls pick the correct Server Certificate.<br />
437            NameVirtualHost 1.2.3.1:443<br />
438            &lt;VirtualHost 1.2.3.1:443&gt;<br />
439            GnuTLSEnable on<br />
440            GnuTLSSessionTickets on<br />
441            GnuTLSPriorities NORMAL<br />
442            DocumentRoot /www/site1.example.com/html<br />
443            ServerName site1.example.com:443<br />
444            GnuTLSCertificateFile conf/ssl/site1.crt<br />
445            GnuTLSKeyFile conf/ss/site1.key<br />
446            &lt;/VirtualHost&gt;<br />
447            &lt;VirtualHost 1.2.3.1:443&gt;<br />
448            GnuTLSEnable on<br />
449            GnuTLSPriorities NORMAL<br />
450            DocumentRoot /www/site2.example.com/html<br />
451            ServerName site2.example.com:443<br />
452            GnuTLSCertificateFile conf/ssl/site2.crt<br />
453            GnuTLSKeyFile conf/ss/site2.key<br />
454            &lt;/VirtualHost&gt;<br />
455            &lt;VirtualHost 1.2.3.1:443&gt;<br />
456            GnuTLSEnable on<br />
457            GnuTLSPriorities NORMAL<br />
458            DocumentRoot /www/site3.example.com/html<br />
459            ServerName site3.example.com:443<br />
460            GnuTLSCertificateFile conf/ssl/site3.crt<br />
461            GnuTLSKeyFile conf/ss/site3.key<br />
462            &lt;/VirtualHost&gt;<br />
463            &lt;VirtualHost 1.2.3.1:443&gt;<br />
464            GnuTLSEnable on<br />
465            GnuTLSPriorities NORMAL<br />
466            DocumentRoot /www/site4.example.com/html<br />
467            ServerName site4.example.com:443<br />
468            GnuTLSCertificateFile conf/ssl/site4.crt<br />
469            GnuTLSKeyFile conf/ss/site4.key<br />
470            &lt;/VirtualHost&gt;<br />
471            </p>
472            </code>
473            </p>
474        </div>
475        <hr />
476        <div id="Performance">
477            <h2>Performance Issues:</h2>
478            <p>
479            mod_gnutls by default uses conservative settings for the server.<br />
480            You can fine tune the configuration to reduce the load on a busy server.<br />
481            The following examples do exactly this:<br />
482            <code>
483            # Load the module into Apache.<br />
484            LoadModule gnutls_module modules/mod_gnutls.so<br />
485            # Using 4 memcache servers to distribute the SSL Session Cache.<br />
486            GnuTLSCache memcache "mc1.example.com mc2.example.com mc3.example.com mc4.example.com"<br />
487            GnuTLSCacheTimeout 600<br />
488            Listen 1.2.3.1:443<br />
489            NameVirtualHost 1.2.3.1:443<br />
490            &lt;VirtualHost 1.2.3.1:443&gt;<br />
491            GnuTLSEnable on<br />
492            # Here we disable the Perfect forward secrecy ciphersuites (DHE)<br />
493            # and disallow AES-256 since AES-128 is just fine.<br />
494            GnuTLSPriorities NORMAL:!DHE-RSA:!DHE-DSS:!AES-256-CBC:%COMPAT<br />
495            DocumentRoot /www/site1.example.com/html<br />
496            ServerName site1.example.com:443<br />
497            GnuTLSCertificateFile conf/ssl/site1.crt<br />
498            GnuTLSKeyFile conf/ss/site1.key<br />
499            &lt;/VirtualHost&gt;<br />
500            &lt;VirtualHost 1.2.3.1:443&gt;<br />
501            GnuTLSEnable on<br />
502            # Here we instead of disabling the DHE ciphersuites we use<br />
503            # Diffie Hellman parameters of smaller size than the default (2048 bits).<br />
504            # Using small numbers from 768 to 1024 bits should be ok once they are<br />
505            # regenerated every few hours.<br />
506            # Use "certtool --generate-dh-params --bits 1024" to get those<br />
507            GnuTLSDHFile /etc/apache2/dh.params<br />
508            GnuTLSPriorities NORMAL:!AES-256-CBC:%COMPAT<br />
509            DocumentRoot /www/site2.example.com/html<br />
510            ServerName site2.example.com:443<br />
511            GnuTLSCertificateFile conf/ssl/site2.crt<br />
512            GnuTLSKeyFile conf/ss/site2.key<br />
513            &lt;/VirtualHost&gt;<br />
514            </code>
515            </p>
516        </div>
517        <hr />
518        <div id="EnvironmentVars">
519            <h2>Environment Variables:</h2>
520            <p>mod_gnutls exports the following environment variables to scripts.<br />
521            These are compatible with mod_ssl.</p>
522            <h6>HTTPS</h6>
523            <p>Can be "on" or "off"</p>
524            <h6>SSL_VERSION_LIBRARY</h6>
525            <p>The version of the gnutls library</p>
526            <h6>SSL_VERSION_INTERFACE</h6>
527            <p>The version of this module</p>
528            <h6>SSL_PROTOCOL</h6>
529            <p>The SSL or TLS protocol name (such as "TLS 1.0" etc.)</p>
530            <h6>SSL_CIPHER</h6>
531            <p>The SSL or TLS cipher suite name</p>
532            <h6>SSL_COMPRESS_METHOD</h6>
533            <p>The negotiated compression method (NULL or DEFLATE)</p>
534            <h6>SSL_SRP_USER</h6>
535            <p>The SRP username used for authentication (only set when GnuTLSSRPPasswdFile and GnuTLSSRPPasswdConfFile are configured).</p>
536            <h6>SSL_CIPHER_USEKEYSIZE &amp; SSL_CIPHER_ALGKEYSIZE</h6>
537            <p>The number if bits used in the used cipher algorithm.</p>
538            <p>This does not fully reflect the security level since the size of</p>
539            <p>RSA or DHE key exchange parameters affect the security level too.</p>
540            <h6>SSL_CIPHER_EXPORT</h6>
541            <p>True or False. Whether the cipher suite negotiated is an export one.</p>
542            <h6>SSL_SESSION_ID</h6>
543            <p>The session ID negotiated in this session. Can be the same during client reloads.</p>
544            <h6>SSL_CLIENT_V_REMAIN</h6>
545            <p>The number of days until the client's certificate is expired.</p>
546            <h6>SSL_CLIENT_V_START</h6>
547            <p>The activation time of client's certificate.</p>
548            <h6>SSL_CLIENT_V_END</h6>
549            <p>The expiration time of client's certificate.</p>
550            <h6>SSL_CLIENT_S_DN</h6>
551            <p>The distinguished name of client's certificate in RFC2253 format.</p>
552            <h6>SSL_CLIENT_I_DN</h6>
553            <p>The SSL or TLS cipher suite name</p>
554            <h6>SSL_CLIENT_S_AN%</h6>
555            <p>These will contain the alternative names of the client certificate (% is a number starting from zero).</p>
556            <p>The values will be prepended by "DNSNAME:", "RFC822NAME:" or "URI:" depending on the type.</p>
557            <p>If it is not supported the value "UNSUPPORTED" will be set.</p>
558            <h6>SSL_SERVER_M_SERIAL</h6>
559            <p>The serial number of the server's certificate.</p>
560            <h6>SSL_SERVER_M_VERSION</h6>
561            <p>The version of the server's certificate.</p>
562            <h6>SSL_SERVER_A_SIG</h6>
563            <p>The algorithm used for the signature in server's certificate.</p>
564            <h6>SSL_SERVER_A_KEY</h6>
565            <p>The public key algorithm in server's certificate.</p>
566            <h6>SSL_SERVER_CERT</h6>
567            <p>The PEM-encoded server certificate.</p>
568            <h6>SSL_SERVER_CERT_TYPE</h6>
569            <p>The certificate type can be X.509 or OPENPGP.</p>
570        </div>
571    </body>
572</html>
Note: See TracBrowser for help on using the repository browser.