source: mod_gnutls/doc/mod_gnutls_manual.mdwn @ b888e8b

debian/masterdebian/stretch-backportsproxy-ticketupstream
Last change on this file since b888e8b was b888e8b, checked in by Thomas Klute <thomas2.klute@…>, 4 years ago

New directive GnuTLSOCSPCheckNonce

Some CAs refuse to send nonces in their OCSP responses, probably
because that way they can cache responses. This makes nonce
verification fail, so give the user an option disable it.

  • Property mode set to 100644
File size: 27.3 KB
Line 
1% `mod_gnutls` Manual
2
3* * * * *
4
5`mod_gnutls` is a module for the Apache web server that provides HTTPS
6(HTTP over Transport Layer Security (TLS) or the older Secure Sockets
7Layer (SSL)) using the GnuTLS library.  More information about the
8module can be found at [the project's website](https://mod.gnutls.org/).
9
10* * * * *
11
12Compilation & Installation
13==========================
14
15`mod_gnutls` uses the `./configure && make && make install` mechanism
16common to many Open Source programs.  Most of the dirty work is
17handled by either `./configure` or Apache's `apxs` utility. If you have
18built Apache modules before, there shouldn't be any surprises for you.
19
20The interesting options you can pass to configure are:
21
22`--with-apxs=PATH`
23:   This option is used to specify the location of the apxs utility that
24    was installed as part of apache. Specify the location of the
25    binary, not the directory it is located in.
26
27`--with-apu-config=PATH`
28:   Path to APR Utility Library config tool (`apu-1-config`)
29
30`--help`
31:   Provides a list of all available configure options.
32
33It is recommended to run `make check` before installation. If your
34system doesn't have a loopback device with IPv6 and IPv4 support or
35`localhost` does not resolve to at least one of `[::1]` and
36`127.0.0.1`, you may have to set the `TEST_HOST` or `TEST_IP`
37environment variables when running `./configure` to make the test
38suite work correctly.
39
40* * * * *
41
42Integration
43===========
44
45To activate `mod_gnutls` just add the following line to your httpd.conf
46and restart Apache:
47
48    LoadModule gnutls_module modules/mod_gnutls.so
49
50* * * * *
51
52Configuration Directives
53========================
54
55General Options
56---------------
57
58### GnuTLSEnable
59
60Enable GnuTLS for this virtual host
61
62    GnuTLSEnable [on|off]
63
64Default: *off*\
65Context: virtual host
66
67This directive enables SSL/TLS Encryption for a Virtual Host.
68
69### GnuTLSCache
70
71Configure TLS Session Cache
72
73    GnuTLSCache [dbm|gdbm|memcache|none] [PATH|SERVERLIST|-]
74
75Default: `GnuTLSCache none`\
76Context: server config
77
78This directive configures the TLS Session Cache for `mod_gnutls`.
79This could be shared between machines of different architectures. If a
80DBM cache is used, access is serialized using the `gnutls-cache`
81mutex.
82
83`dbm` (Requires Berkeley DBM)
84:   Uses the default Berkeley DB backend of APR DBM to cache TLS
85    Session data. The argument is a relative or absolute path to
86    be used as the DBM Cache file. This is compatible with most
87    operating systems, but needs the Apache Runtime to be compiled
88    with Berkeley DBM support.
89
90`gdbm`
91:   Uses the GDBM backend of APR DBM to cache TLS Session data.
92
93    The argument is a relative or absolute path to be used as the DBM Cache
94    file.  This is the recommended option.
95
96`memcache`
97:   Uses memcached server(s) to cache TLS Session data.
98
99    The argument is a space separated list of servers. If no port
100    number is supplied, the default of 11211 is used.  This can be
101    used to share a session cache between all servers in a cluster.
102
103`none`
104:   Turns off all caching of TLS Sessions.
105
106    This can significantly reduce the performance of `mod_gnutls` since
107    even followup connections by a client must renegotiate parameters
108    instead of reusing old ones.  This is the default, since it
109    requires no configuration.
110
111### GnuTLSCacheTimeout
112
113Timeout for TLS Session Cache expiration
114
115    GnuTLSCacheTimeout SECONDS
116
117Default: `GnuTLSCacheTimeout 300`\
118Context: server config
119
120Sets the timeout for TLS Session Cache entries expiration. This value
121is also used for OCSP responses if they do not contain a `nextUpdate`
122time.
123
124### GnuTLSSessionTickets
125
126Enable Session Tickets for the server
127
128    GnuTLSSessionTickets [on|off]
129
130Default: `off`\
131Context: server config, virtual host
132
133To avoid storing data for TLS session resumption the server can
134provide clients with tickets, to use on return. Tickets are an
135alternative to using a session cache, mostly used for busy servers
136with limited storage. For a pool of servers this option is not
137recommended since the tickets are bound to the issuing server only.
138
139If this option is set in the global configuration, virtual hosts
140without a `GnuTLSSessionTickets` setting will use the global setting.
141
142*Warning:* Currently the master key that protects the tickets is
143generated only on server start, and there is no mechanism to roll over
144the key. If session tickets are enabled it is highly recommened to
145restart the server regularly to protect past sessions in case an
146attacker gains access to server memory.
147
148### GnuTLSClientVerify
149
150Enable Client Certificate Verification
151
152    GnuTLSClientVerify [ignore|request|require]
153
154Default: `ignore`\
155Context: server config, virtual host, directory, .htaccess
156
157This directive controls the use of TLS Client Certificate
158Authentication. If used in the .htaccess context, it can force TLS
159re-negotiation.
160
161`ignore`
162:   `mod_gnutls` will ignore the contents of any TLS Client Certificates
163    sent. It will not request that the client sends a certificate.
164
165`request`
166:   The client certificate will be requested, but not required.
167    The Certificate will be validated if sent.  The output of the
168    validation status will be stored in the `SSL_CLIENT_VERIFY`
169    environment variable and can be `SUCCESS`, `FAILED` or `NONE`.
170
171`require`
172:   A Client certificate will be required. Any requests without a valid
173    client certificate will be denied.  The `SSL_CLIENT_VERIFY`
174    environment variable will only be set to `SUCCESS`.
175
176### GnuTLSDHFile
177
178Set to the PKCS \#3 encoded Diffie Hellman parameters
179
180    GnuTLSDHFile FILEPATH
181
182Default: *none*\
183Context: server config, virtual host
184
185Takes an absolute or relative path to a PKCS \#3 encoded DH
186parameters.Those are used when the DHE key exchange method is enabled.
187You can generate this file using `certtool --generate-dh-params --bits
1882048`.  If not set `mod_gnutls` will use the included parameters.
189
190### GnuTLSPriorities
191
192Set the allowed protocol versions, ciphers, key exchange algorithms,
193MACs and compression methods
194
195    GnuTLSPriorities NORMAL:+CIPHER_0:+CIPHER_1:...:+CIPHER_N
196
197Default: *none*\
198Context: server config, virtual host
199
200Takes a colon separated list of protocol version, ciphers, key
201exchange methods message authentication codes, and compression methods
202to enable. The allowed keywords are specified in the
203`gnutls_priority_init()` function of GnuTLS.
204
205Please refer to [the GnuTLS documentation](https://gnutls.org/manual/html_node/Priority-Strings.html#Priority-Strings)
206for details. A few commonly used sets are listed below, note that
207their exact meaning may change with GnuTLS versions.
208
209`PERFORMANCE`
210:   A list with all the secure cipher combinations sorted in terms of
211    performance.
212
213`NORMAL`
214:   A list with all the secure cipher combinations sorted
215    with respect to security margin (subjective term).
216
217`SECURE128`
218:   A list with all the secure cipher suites that offer a security level
219    of 128-bit or more.
220
221`PFS`
222:   Only cipher suites offering perfect forward secrecy (ECDHE and DHE),
223    sorted by security margin.
224
225You can add or remove algorithms using the `+` and `!` prefixes
226respectively. For example, in order to use the `NORMAL` set but
227disable TLS 1.0 and 1.1 you can use the string
228`NORMAL:!VERS-TLS1.0:!VERS-TLS1.1`.
229
230You can find a list of all supported Ciphers, Versions, MACs, etc.  by
231running `gnutls-cli --list`.
232
233### GnuTLSP11Module
234
235Load this PKCS #11 module.
236
237    GnuTLSP11Module PATH_TO_LIBRARY
238
239Default: *none*\
240Context: server config
241
242Load this PKCS #11 provider module, instead of the system
243defaults. May occur multiple times to load multiple modules.
244
245### GnuTLSPIN
246
247Set the PIN to be used to access encrypted key files or PKCS #11 objects.
248
249    GnuTLSPIN XXXXXX
250
251Default: *none*\
252Context: server config, virtual host
253
254Takes a string to be used as a PIN for the protected objects in
255a security module, or as a key to be used to decrypt PKCS #8, PKCS #12,
256or openssl encrypted keys.
257
258### GnuTLSSRKPIN
259
260Set the SRK PIN to be used to access the TPM.
261
262    GnuTLSSRKPIN XXXXXX
263
264Default: *none*\
265Context: server config, virtual host
266
267Takes a string to be used as a PIN for the protected objects in
268the TPM module.
269
270### GnuTLSExportCertificates
271
272Export the PEM encoded certificates to CGIs
273
274    GnuTLSExportCertificates [off|on|SIZE]
275
276Default: `off`\
277Context: server config, virtual host
278
279This directive configures exporting the full certificates of the
280server and the client to CGI scripts via the `SSL_SERVER_CERT` and
281`SSL_CLIENT_CERT` environment variables. The exported certificates
282will be PEM-encoded (if X.509) or ASCII-armored (if OpenPGP) up to the
283size given.  The type of the certificate will be exported in
284`SSL_SERVER_CERT_TYPE` and `SSL_CLIENT_CERT_TYPE`.
285
286SIZE should be an integer number of bytes, or may be written with a
287trailing `K` to indicate kibibytes.  `off` means the same thing as
288`0`, in which case the certificates will not be exported to the
289environment.  `on` is an alias for `16K`.  If a non-zero size is
290specified for this directive, but a certificate is too large to fit in
291the buffer, then the corresponding environment variable will contain
292the fixed string `GNUTLS_CERTIFICATE_SIZE_LIMIT_EXCEEDED`.
293
294With GnuTLSExportCertificates enabled, `mod_gnutls` exports the same
295environment variables to the CGI process as `mod_ssl`.
296
297X.509 Certificate Authentication
298--------------------------------
299
300### GnuTLSCertificateFile
301
302Set to the PEM Encoded Server Certificate
303
304    GnuTLSCertificateFile FILEPATH
305
306Default: *none*\
307Context: server config, virtual host
308
309Takes an absolute or relative path to a PEM-encoded X.509 certificate to
310use as this Server's End Entity (EE) certificate. If you need to supply
311certificates for intermediate Certificate Authorities (iCAs), they
312should be listed in sequence in the file, from EE to the iCA closest to
313the root CA. Optionally, you can also include the root CA's certificate
314as the last certificate in the list.
315
316Since version 0.7 this can be a PKCS #11 URL.
317
318### GnuTLSKeyFile
319
320Set to the PEM Encoded Server Private Key
321
322    GnuTLSKeyFile FILEPATH
323
324Default: *none*\
325Context: server config, virtual host
326
327Takes an absolute or relative path to the Server Private Key. Set
328`GnuTLSPIN` if the key file is encrypted.
329
330Since version 0.7 this can be a PKCS #11 URL.
331
332**Security Warning:**\
333This private key must be protected. It is read while Apache is still
334running as root, and does not need to be readable by the nobody or
335apache user.
336
337### GnuTLSClientCAFile
338
339Set the PEM encoded Certificate Authority list to use for X.509 base
340client authentication
341
342    GnuTLSClientCAFile FILEPATH
343
344Default: *none*
345Context: server config, virtual host
346
347Takes an absolute or relative path to a PEM Encoded Certificate to use
348as a Certificate Authority with Client Certificate Authentication.
349This file may contain a list of trusted authorities.
350
351OpenPGP Certificate Authentication
352----------------------------------
353
354### GnuTLSPGPCertificateFile
355
356Set to a base64 Encoded Server OpenPGP Certificate
357
358    GnuTLSPGPCertificateFile FILEPATH
359
360Default: *none*\
361Context: server config, virtual host
362
363Takes an absolute or relative path to a base64 Encoded OpenPGP
364Certificate to use as this Server's Certificate.
365
366### GnuTLSPGPKeyFile
367
368Set to the Server OpenPGP Secret Key
369
370    GnuTLSPGPKeyFile FILEPATH
371
372Default: *none*\
373Context: server config, virtual host
374
375Takes an absolute or relative path to the Server Private Key. This key
376cannot currently be password protected.
377
378**Security Warning:**\
379 This private key must be protected. It is read while Apache is still
380running as root, and does not need to be readable by the nobody or
381apache user.
382
383### GnuTLSPGPKeyringFile
384
385Set to a base64 Encoded key ring
386
387    GnuTLSPGPKeyringFile FILEPATH
388
389Default: *none*\
390Context: server config, virtual host
391
392Takes an absolute or relative path to a base64 Encoded Certificate
393list (key ring) to use as a means of verification of Client
394Certificates.  This file should contain a list of trusted signers.
395
396SRP Authentication
397------------------
398
399### GnuTLSSRPPasswdFile
400
401Set to the SRP password file for SRP ciphersuites
402
403    GnuTLSSRPPasswdFile FILEPATH
404
405Default: *none*\
406Context: server config, virtual host
407
408Takes an absolute or relative path to an SRP password file. This is
409the same format as used in libsrp.  You can generate such file using
410the command `srptool --passwd /etc/tpasswd --passwd-conf
411/etc/tpasswd.conf -u test` to set a password for user test.  This
412password file holds the username, a password verifier and the
413dependency to the SRP parameters.
414
415### GnuTLSSRPPasswdConfFile
416
417Set to the SRP password.conf file for SRP ciphersuites
418
419    GnuTLSSRPPasswdConfFile FILEPATH
420
421Default: *none*\
422Context: server config, virtual host
423
424Takes an absolute or relative path to an SRP password.conf file. This
425is the same format as used in `libsrp`.  You can generate such file
426using the command `srptool --create-conf /etc/tpasswd.conf`.  This
427file holds the SRP parameters and is associate with the password file
428(the verifiers depends on these parameters).
429
430TLS Proxy Configuration
431-----------------------
432
433### GnuTLSProxyEngine
434
435Enable TLS proxy connections for this virtual host
436
437    GnuTLSProxyEngine [on|off]
438
439Default: *off*\
440Context: virtual host
441
442This directive enables support for TLS proxy connections for a virtual
443host.
444
445### GnuTLSProxyCAFile
446
447Set to the PEM encoded Certificate Authority Certificate
448
449    GnuTLSProxyCAFile FILEPATH
450
451Default: *none*\
452Context: server config, virtual host
453
454Takes an absolute or relative path to a PEM encoded certificate to use
455as a Certificate Authority when verifying certificates provided by
456proxy back end servers. This file may contain a list of trusted
457authorities. If not set, verification of TLS back end servers will
458always fail due to lack of a trusted CA.
459
460### GnuTLSProxyCRLFile
461
462Set to the PEM encoded Certificate Revocation List
463
464    GnuTLSProxyCRLFile FILEPATH
465
466Default: *none*\
467Context: server config, virtual host
468
469Takes an absolute or relative path to a PEM encoded Certificate
470Revocation List to use when verifying certificates provided by proxy
471back end servers. The file may contain a list of CRLs.
472
473### GnuTLSProxyCertificateFile
474
475Set to the PEM encoded Client Certificate
476
477    GnuTLSProxyCertificateFile FILEPATH
478
479Default: *none*\
480Context: server config, virtual host
481
482Takes an absolute or relative path to a PEM encoded X.509 certificate
483to use as this Server's End Entity (EE) client certificate for TLS
484client authentication in proxy TLS connections. If you need to supply
485certificates for intermediate Certificate Authorities (iCAs), they
486should be listed in sequence in the file, from EE to the iCA closest
487to the root CA. Optionally, you can also include the root CA's
488certificate as the last certificate in the list.
489
490If not set, TLS client authentication will be disabled for TLS proxy
491connections. If set, `GnuTLSProxyKeyFile` must be set as well to
492provide the matching private key.
493
494### GnuTLSProxyKeyFile
495
496Set to the PEM encoded Private Key
497
498    GnuTLSProxyKeyFile FILEPATH
499
500Default: *none*\
501Context: server config, virtual host
502
503Takes an absolute or relative path to the Private Key matching the
504certificate configured using the `GnuTLSProxyCertificateFile`
505directive. This key cannot currently be password protected.
506
507**Security Warning:**\
508This private key must be protected. It is read while Apache is still
509running as root, and does not need to be readable by the nobody or
510apache user.
511
512### GnuTLSProxyPriorities
513
514Set the allowed ciphers, key exchange algorithms, MACs and compression
515methods for proxy connections
516
517    GnuTLSProxyPriorities NORMAL:+CIPHER_0:+CIPHER_1:...:+CIPHER_N
518
519Default: *none*\
520Context: server config, virtual host
521
522This option is used to set the allowed ciphers, key exchange
523algorithms, MACs and compression methods for proxy connections. It
524takes the same parameters as `GnuTLSPriorities`. Required if
525`GnuTLSProxyEngine` is `On`.
526
527OCSP Stapling Configuration
528---------------------------
529
530### GnuTLSOCSPStapling
531
532Enable OCSP stapling for this (virtual) host.
533
534    GnuTLSOCSPStapling [On|Off]
535
536Default: *off*\
537Context: server config, virtual host
538
539OCSP stapling, formally known as the TLS Certificate Status Request
540extension, allows the server to provide the client with an OCSP
541response for its certificate during the handshake. This way the client
542does not have to send an OCSP request to the CA to check the
543certificate status, which offers privacy and performance advantages.
544
545Using OCSP stapling has a few requirements:
546
547* Caching OCSP responses requires a cache, so `GnuTLSCache` must not
548  be `none`.
549* `GnuTLSCertificateFile` must contain the issuer CA certificate in
550  addition to the server certificate so responses can be verified.
551* The certificate must either contain an OCSP access URI using HTTP,
552  or `GnuTLSOCSPResponseFile` must be set.
553
554OCSP cache updates are serialized using the `gnutls-ocsp` mutex.
555
556### GnuTLSOCSPCheckNonce
557
558Check the nonce in OCSP responses?
559
560    GnuTLSOCSPCheckNonce [On|Off]
561
562Default: *on*\
563Context: server config, virtual host
564
565Some CAs refuse to send nonces in their OCSP responses, probably
566because that way they can cache responses. If your CA is one of them
567you can use this flag to disable nonce verification. Note that
568`mod_gnutls` will _send_ a nonce either way.
569
570### GnuTLSOCSPResponseFile
571
572Read the OCSP response for stapling from this file instead of sending
573a request over HTTP.
574
575    GnuTLSOCSPResponseFile /path/to/response.der
576
577Default: *empty*\
578Context: server config, virtual host
579
580The response file must be updated externally, for example using a cron
581job. This option is an alternative to the server fetching OCSP
582responses over HTTP. Reasons to use this option include:
583
584* Performing OCSP requests separate from the web server, to prevent slow
585  responses from stalling handshakes.
586* The issuer CA uses an access method other than HTTP.
587* Testing
588
589You can use a GnuTLS `ocsptool` command like the following to create
590and update the response file:
591
592    ocsptool --ask --nonce --load-issuer ca_cert.pem \
593        --load-cert server_cert.pem --outfile ocsp_response.der
594
595Additional error checking is highly recommended. You may have to
596remove the `--nonce` option if the OCSP responder of your CA does not
597support nonces.
598
599### GnuTLSOCSPGraceTime
600
601Replace cached OCSP responses this many seconds before they expire.
602
603    GnuTLSOCSPGraceTime SECONDS
604
605Default: *60*\
606Context: server config, virtual host
607
608A cached OCSP response should be updated a little before it expires to
609account for potential clock skew between server, CA, and client, as
610well as transmission time in corner cases. Note that a response
611without a `nextUpdate` field will be subject to the default cache
612lifetime.
613
614### GnuTLSOCSPFailureTimeout
615
616Wait this many seconds before retrying a failed OCSP request.
617
618    GnuTLSOCSPFailureTimeout SECONDS
619
620Default: *300*\
621Context: server config, virtual host
622
623Retries of failed OCSP requests must be rate limited to avoid
624overloading both the server using mod_gnutls and the CA's OCSP
625responder. A shorter value increases the load on both sides, a longer
626one means that stapling will remain disabled for longer after a failed
627request.
628
629### GnuTLSOCSPSocketTimeout
630
631Timeout for TCP sockets used to send OCSP requests
632
633    GnuTLSOCSPFailureTimeout SECONDS
634
635Default: *6*\
636Context: server config, virtual host
637
638Stalled OCSP requests must time out after a while to prevent stalling
639the server too much. However, if the timeout is too short requests may
640fail with a slow OCSP responder or high latency network
641connection. This parameter allows you to adjust the timeout if
642necessary.
643
644Note that this is not an upper limit for the completion of an OCSP
645request but a socket timeout. The connection will time out if there is
646no activity (successful send or receive) at all for the configured
647time.
648
649* * * * *
650
651Configuration Examples
652======================
653
654Simple Standard TLS Example
655---------------------------
656
657The following is an example of simple TLS hosting, using one IP
658Addresses for each virtual host.
659
660     # Load the module into Apache.
661     LoadModule gnutls_module modules/mod_gnutls.so
662     GnuTLSCache gdbm /var/cache/www-tls-cache
663     GnuTLSCacheTimeout 500
664
665     # Without SNI you need one IP Address per-site.
666     Listen 192.0.2.1:443
667     Listen 192.0.2.2:443
668     Listen 192.0.2.3:443
669     Listen 192.0.2.4:443
670
671     <VirtualHost 192.0.2.1:443>
672         GnuTLSEnable on
673         GnuTLSPriorities SECURE128
674         DocumentRoot /www/site1.example.com/html
675         ServerName site1.example.com:443
676         GnuTLSCertificateFile conf/tls/site1.crt
677         GnuTLSKeyFile conf/tls/site1.key
678     </VirtualHost>
679
680     <VirtualHost 192.0.2.2:443>
681         # This virtual host enables SRP authentication
682         GnuTLSEnable on
683         GnuTLSPriorities NORMAL:+SRP
684         DocumentRoot /www/site2.example.com/html
685         ServerName site2.example.com:443
686         GnuTLSSRPPasswdFile conf/tls/tpasswd.site2
687         GnuTLSSRPPasswdConfFile conf/tls/tpasswd.site2.conf
688     </VirtualHost>
689
690     <VirtualHost 192.0.2.3:443>
691         # This server enables SRP, OpenPGP and X.509 authentication.
692         GnuTLSEnable on
693         GnuTLSPriorities NORMAL:+SRP:+SRP-RSA:+SRP-DSS:+CTYPE-OPENPGP
694         DocumentRoot /www/site3.example.com/html
695         ServerName site3.example.com:443
696         GnuTLSCertificateFile conf/tls/site3.crt
697         GnuTLSKeyFile conf/tls/site3.key
698         GnuTLSClientVerify ignore
699         GnuTLSPGPCertificateFile conf/tls/site3.pub.asc
700         GnuTLSPGPKeyFile conf/tls/site3.sec.asc
701         GnuTLSSRPPasswdFile conf/tls/tpasswd.site3
702         GnuTLSSRPPasswdConfFile conf/tls/tpasswd.site3.conf
703     </VirtualHost>
704
705     <VirtualHost 192.0.2.4:443>
706         GnuTLSEnable on
707         # %COMPAT disables some security features to enable maximum
708         # compatibility with clients. Don't use this if you need strong
709         # security.
710         GnuTLSPriorities NORMAL:%COMPAT
711         DocumentRoot /www/site4.example.com/html
712         ServerName site4.example.com:443
713         GnuTLSCertificateFile conf/tls/site4.crt
714         GnuTLSKeyFile conf/tls/site4.key
715     </VirtualHost>
716
717Server Name Indication Example
718------------------------------
719
720`mod_gnutls` supports "Server Name Indication", as specified in
721RFC 3546. This allows hosting many TLS websites with a single IP
722address. All recent browsers support this standard. Here is an
723example using SNI:
724
725     # Load the module into Apache.
726     LoadModule gnutls_module modules/mod_gnutls.so
727
728     # SNI allows hosting multiple sites using one IP address. This
729     # could also be 'Listen *:443', just like '*:80' is common for
730     # non-HTTPS
731     Listen 198.51.100.1:443
732
733     <VirtualHost _default_:443>
734         GnuTLSEnable on
735         GnuTLSSessionTickets on
736         GnuTLSPriorities NORMAL
737         DocumentRoot /www/site1.example.com/html
738         ServerName site1.example.com:443
739         GnuTLSCertificateFile conf/tls/site1.crt
740         GnuTLSKeyFile conf/tls/site1.key
741     </VirtualHost>
742
743     <VirtualHost _default_:443>
744         GnuTLSEnable on
745         GnuTLSPriorities NORMAL
746         DocumentRoot /www/site2.example.com/html
747         ServerName site2.example.com:443
748         GnuTLSCertificateFile conf/tls/site2.crt
749         GnuTLSKeyFile conf/tls/site2.key
750     </VirtualHost>
751
752     <VirtualHost _default_:443>
753         GnuTLSEnable on
754         GnuTLSPriorities NORMAL
755         DocumentRoot /www/site3.example.com/html
756         ServerName site3.example.com:443
757         GnuTLSCertificateFile conf/tls/site3.crt
758         GnuTLSKeyFile conf/tls/site3.key
759     </VirtualHost>
760
761     <VirtualHost _default_:443>
762         GnuTLSEnable on
763         GnuTLSPriorities NORMAL
764         DocumentRoot /www/site4.example.com/html
765         ServerName site4.example.com:443
766         GnuTLSCertificateFile conf/tls/site4.crt
767         GnuTLSKeyFile conf/tls/site4.key
768     </VirtualHost>
769
770OCSP Stapling Example
771---------------------
772
773This example uses an X.509 server certificate. The server will fetch
774OCSP responses from the responder listed in the certificate and store
775them im a memcached cache shared with another server.
776
777     # Load the module into Apache.
778     LoadModule gnutls_module modules/mod_gnutls.so
779     GnuTLSCache memcache "192.0.2.1:11211 192.0.2.2:11211"
780     GnuTLSCacheTimeout 600
781
782     Listen 192.0.2.1:443
783
784     <VirtualHost _default_:443>
785         GnuTLSEnable          On
786         GnuTLSPriorities      NORMAL
787         DocumentRoot          /www/site1.example.com/html
788         ServerName            site1.example.com:443
789         GnuTLSCertificateFile conf/tls/site1.crt
790         GnuTLSKeyFile         conf/tls/site1.key
791         GnuTLSPriorities      NORMAL
792         GnuTLSOCSPStapling    On
793     </VirtualHost>
794
795* * * * *
796
797Environment Variables
798=====================
799
800`mod_gnutls` exports the following environment variables to scripts.
801These are compatible with `mod_ssl`.
802
803`HTTPS`
804-------
805
806Can be `on` or `off`
807
808`SSL_VERSION_LIBRARY`
809---------------------
810
811The version of the GnuTLS library
812
813`SSL_VERSION_INTERFACE`
814-----------------------
815
816The version of this module
817
818`SSL_PROTOCOL`
819--------------
820
821The SSL or TLS protocol name (such as `TLS 1.0` etc.)
822
823`SSL_CIPHER`
824------------
825
826The SSL or TLS cipher suite name
827
828`SSL_COMPRESS_METHOD`
829---------------------
830
831The negotiated compression method (`NULL` or `DEFLATE`)
832
833`SSL_SRP_USER`
834--------------
835
836The SRP username used for authentication (only set when
837`GnuTLSSRPPasswdFile` and `GnuTLSSRPPasswdConfFile` are configured).
838
839`SSL_CIPHER_USEKEYSIZE` & `SSL_CIPHER_ALGKEYSIZE`
840-------------------------------------------------
841
842The number if bits used in the used cipher algorithm.
843
844This does not fully reflect the security level since the size of
845RSA or DHE key exchange parameters affect the security level too.
846
847`SSL_DH_PRIME_BITS`
848-------------------
849
850The number if bits in the modulus for the DH group, if DHE or static
851DH is used.
852
853This will not be set if DH is not used.
854
855`SSL_CIPHER_EXPORT`
856-------------------
857
858`True` or `False`. Whether the cipher suite negotiated is an export one.
859
860`SSL_SESSION_ID`
861----------------
862
863The session ID negotiated in this session. Can be the same during client
864reloads.
865
866`SSL_CLIENT_V_REMAIN`
867---------------------
868
869The number of days until the client's certificate is expired.
870
871`SSL_CLIENT_V_START`
872--------------------
873
874The activation time of client's certificate.
875
876`SSL_CLIENT_V_END`
877------------------
878
879The expiration time of client's certificate.
880
881`SSL_CLIENT_S_DN`
882-----------------
883
884The distinguished name of client's certificate in RFC2253 format.
885
886`SSL_CLIENT_I_DN`
887-----------------
888
889The SSL or TLS cipher suite name
890
891`SSL_CLIENT_S_AN%`
892------------------
893
894These will contain the alternative names of the client certificate (`%` is
895a number starting from zero).
896
897The values will be prepended by `DNSNAME:`, `RFC822NAME:` or `URI:`
898depending on the type.
899
900If it is not supported the value `UNSUPPORTED` will be set.
901
902`SSL_SERVER_M_SERIAL`
903---------------------
904
905The serial number of the server's certificate.
906
907`SSL_SERVER_M_VERSION`
908----------------------
909
910The version of the server's certificate.
911
912`SSL_SERVER_A_SIG`
913------------------
914
915The algorithm used for the signature in server's certificate.
916
917`SSL_SERVER_A_KEY`
918------------------
919
920The public key algorithm in server's certificate.
921
922`SSL_SERVER_CERT`
923------------------
924
925The PEM-encoded (X.509) or ASCII-armored (OpenPGP) server certificate
926(see the `GnuTLSExportCertificates` directive).
927
928`SSL_SERVER_CERT_TYPE`
929----------------------
930
931The certificate type can be `X.509` or `OPENPGP`.
932
933`SSL_CLIENT_CERT`
934------------------
935
936The PEM-encoded (X.509) or ASCII-armored (OpenPGP) client certificate
937(see the `GnuTLSExportCertificates` directive).
938
939`SSL_CLIENT_CERT_TYPE`
940----------------------
941
942The certificate type can be `X.509` or `OPENPGP`.
Note: See TracBrowser for help on using the repository browser.