mod_gnutls DocumentationCompilation
The interesting options you can pass to configure are:
./configure --with-apxs=/usr/sbin/apxs2 --with-libgnutls=/usr make make install Integration into ApacheTo activate ExamplesSome example configuration and the exported variables to scripts can be found in the following sections: Configuring with Apache
Standard SSL ExampleThe following is an example of standard SSL Hosting, using one IP Addresses for each virtual host: # Load the module into Apache. LoadModule gnutls_module modules/mod_gnutls.so # Using 4 memcache servers to distribute the SSL Session Cache. GnuTLSCache memcache "mc1.example.com mc2.example.com mc3.example.com mc4.example.com" GnuTLSCacheTimeout 500 # With normal SSL Websites, you need one IP Address per-site. Listen 1.2.3.1:443 Listen 1.2.3.2:443 Listen 1.2.3.3:443 Listen 1.2.3.4:443 <VirtualHost 1.2.3.1:443> GnuTLSEnable on GnuTLSPriorities NONE:+AES-128-CBC:+3DES-CBC:+ARCFOUR-128:+RSA:+DHE-RSA:+DHE-DSS:+SHA1:+MD5:+COMP-NULL DocumentRoot /www/site1.example.com/html ServerName site1.example.com:443 GnuTLSCertificateFile conf/ssl/site1.crt GnuTLSKeyFile conf/ss/site1.key </VirtualHost> <VirtualHost 1.2.3.2:443> # This virtual host enables SRP authentication GnuTLSEnable on GnuTLSPriorities NORMAL:+SRP DocumentRoot /www/site2.example.com/html ServerName site2.example.com:443 GnuTLSSRPPasswdFile conf/ssl/tpasswd.site2 GnuTLSSRPPasswdConfFile conf/ssl/tpasswd.site2.conf </VirtualHost> <VirtualHost 1.2.3.3:443> # This server enables SRP, OpenPGP and X.509 authentication. GnuTLSEnable on GnuTLSPriorities NORMAL:+SRP:+SRP-RSA:+SRP-DSS DocumentRoot /www/site3.example.com/html ServerName site3.example.com:443 GnuTLSCertificateFile conf/ssl/site3.crt GnuTLSKeyFile conf/ss/site3.key GnuTLSClientVerify ignore GnuTLSPGPCertificateFile conf/ss/site3.pub.asc GnuTLSPGPKeyFile conf/ss/site3.sec.asc GnuTLSSRPPasswdFile conf/ssl/tpasswd.site3 GnuTLSSRPPasswdConfFile conf/ssl/tpasswd.site3.conf </VirtualHost> <VirtualHost 1.2.3.4:443> GnuTLSEnable on # %COMPAT disables some security features to enable maximum compatibility with clients. GnuTLSPriorities NONE:+AES-128-CBC:+ARCFOUR-128:+RSA:+SHA1:+MD5:+COMP-NULL:%COMPAT DocumentRoot /www/site4.example.com/html ServerName site4.example.com:443 GnuTLSCertificateFile conf/ssl/site4.crt GnuTLSKeyFile conf/ss/site4.key </VirtualHost> Server Name Indication Example
# Load the module into Apache. LoadModule gnutls_module modules/mod_gnutls.so # Using 4 memcache servers to distribute the SSL Session Cache. GnuTLSCache memcache "mc1.example.com mc2.example.com mc3.example.com mc4.example.com" GnuTLSCacheTimeout 500 # With normal SSL Websites, you need one IP Address per-site. Listen 1.2.3.1:443 # This could also be 'Listen *:443', # just like '*:80' is common for non-https # This tells apache, that for this IP/Port combination, we want to use # Name Based Virtual Hosting. In the case of Server Name Indication, # it lets mod_gnutls pick the correct Server Certificate. NameVirtualHost 1.2.3.1:443 <VirtualHost 1.2.3.1:443> GnuTLSEnable on GnuTLSPriorities NORMAL DocumentRoot /www/site1.example.com/html ServerName site1.example.com:443 GnuTLSCertificateFile conf/ssl/site1.crt GnuTLSKeyFile conf/ss/site1.key </VirtualHost> <VirtualHost 1.2.3.1:443> GnuTLSEnable on GnuTLSPriorities NORMAL DocumentRoot /www/site2.example.com/html ServerName site2.example.com:443 GnuTLSCertificateFile conf/ssl/site2.crt GnuTLSKeyFile conf/ss/site2.key </VirtualHost> <VirtualHost 1.2.3.1:443> GnuTLSEnable on GnuTLSPriorities NORMAL DocumentRoot /www/site3.example.com/html ServerName site3.example.com:443 GnuTLSCertificateFile conf/ssl/site3.crt GnuTLSKeyFile conf/ss/site3.key </VirtualHost> <VirtualHost 1.2.3.1:443> GnuTLSEnable on GnuTLSPriorities NORMAL DocumentRoot /www/site4.example.com/html ServerName site4.example.com:443 GnuTLSCertificateFile conf/ssl/site4.crt GnuTLSKeyFile conf/ss/site4.key </VirtualHost> Performance Issues
# Load the module into Apache. LoadModule gnutls_module modules/mod_gnutls.so # Using 4 memcache servers to distribute the SSL Session Cache. GnuTLSCache memcache "mc1.example.com mc2.example.com mc3.example.com mc4.example.com" GnuTLSCacheTimeout 600 Listen 1.2.3.1:443 NameVirtualHost 1.2.3.1:443 <VirtualHost 1.2.3.1:443> GnuTLSEnable on # Here we disable the Perfect forward secrecy ciphersuites (DHE) # and disallow AES-256 since AES-128 is just fine. GnuTLSPriorities NORMAL:!DHE-RSA:!DHE-DSS:!AES-256-CBC:%COMPAT DocumentRoot /www/site1.example.com/html ServerName site1.example.com:443 GnuTLSCertificateFile conf/ssl/site1.crt GnuTLSKeyFile conf/ss/site1.key </VirtualHost> <VirtualHost 1.2.3.1:443> GnuTLSEnable on # Here we instead of disabling the DHE ciphersuites we use # Diffie Hellman parameters of smaller size than the default (2048 bits). # Using small numbers from 768 to 1024 bits should be ok once they are # regenerated every few hours. # Use "certtool --generate-dh-params --bits 1024" to get those GnuTLSDHFile /etc/apache2/dh.params GnuTLSPriorities NORMAL:!AES-256-CBC:%COMPAT DocumentRoot /www/site2.example.com/html ServerName site2.example.com:443 GnuTLSCertificateFile conf/ssl/site2.crt GnuTLSKeyFile conf/ss/site2.key </VirtualHost> Environment variables
GnuTLSCache
This directive configures the SSL Session Cache for
GnuTLSCache memcache "10.0.0.1 10.0.0.2 10.0.0.3" GnuTLSCacheTimeout
Sets the timeout for SSL Session Cache entries. GnuTLSCertificateFile
Takes an absolute or relative path to a PEM Encoded Certificate to use as this Server's Certificate. Example Usage:GnuTLSCertificateFile conf/ssl/server.crt GnuTLSPGPCertificateFile
Takes an absolute or relative path to a base64 Encoded OpenPGP Certificate to use as this Server's Certificate. Example Usage:GnuTLSPGPCertificateFile conf/ssl/server.asc GnuTLSClientVerify
This directive controls the use of SSL Client Certificate Authentication. If used in the
<Directory "/path/to/my/docroot"> GnuTLSClientVerify require </Directory> GnuTLSClientCAFile
Takes an absolute or relative path to a PEM Encoded Certificate to use as a Certificate Authority with Client Certificate Authentication. This file may contain a list of trusted authorities. Example Usage:GnuTLSClientCAFile conf/ssl/ca.crt GnuTLSPGPKeyringFile
Takes an absolute or relative path to a base64 Encoded Certificate list (key ring) to use as a means of verification of Client Certificates. This file should contain a list of trusted signers. Example Usage:GnuTLSPGPKeyringFile conf/ssl/ring.asc GnuTLSEnable
This directive enables SSL/TLS Encryption for a Virtual Host. <VirtualHost 1.2.3.4:443> GnuTLSEnable on # other directives for the Virtual Host. </VirtualHost> GnuTLSExportCertificates
This directive enables exporting the full PEM encoded certificates of
the server and the client to CGIs. This makes <VirtualHost 1.2.3.4:443> GnuTLSExportCertificates on # other directives for the Virtual Host. </VirtualHost> GnuTLSKeyFile
Takes an absolute or relative path to the Server Private Key. This key cannot currently be password protected. Example Usage:GnuTLSKeyFile conf/ssl/server.key
Security Warning: 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.
GnuTLSPGPKeyFile
Takes an absolute or relative path to the Server Private Key. This key cannot currently be password protected. Example Usage:GnuTLSPGPKeyFile conf/ssl/server.asc
Security Warning: 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.
GnuTLSDHFile
Takes an absolute or relative path to a PKCS #3 encoded DH parameters. Those are used when the DHE key exchange method is enabled. You can generate this file using
"certtool --generate-dh-params --bits 2048". If not set GnuTLSDHFile conf/ssl/dhparams GnuTLSRSAFile
Takes an absolute or relative path to a PKCS #1 encoded RSA parameters. Those are used when the RSA-EXPORT key exchange method is enabled. You can generate this file using "certtool --generate-privkey --bits 512". These parameters should not contain key of longer of 512 bits (due to the export restrictions). If not set GnuTLSRSAFile conf/ssl/rsaparams GnuTLSSRPPasswdFile
Takes an absolute or relative path to an SRP password file. This is the same format as used in libsrp. 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. This password file holds the username, a password verifier and the dependency to the SRP parameters. Example Usage:GnuTLSSRPPasswdFile conf/ssl/tpasswd GnuTLSSRPPasswdConfFile
Takes an absolute or relative path to an SRP password.conf file. This is the same format as used in libsrp. You can generate such file using the command "srptool --create-conf /etc/tpasswd.conf". This file holds the SRP parameters and is associate with the password file (the verifiers depends on these parameters). Example Usage:GnuTLSSRPPasswdConfFile conf/ssl/tpasswd.conf GnuTLSPriorities
Takes a semi-colon separated list of ciphers, key exchange methods
Message authentication codes and compression methods to enable. The
allowed keywords are specified in the In brief you can specify a set of ciphersuites from the choices:
NORMAL:!ARCFOUR-128 . Other options such as the protocol
version and the compression method can be specified using the
VERS- and COMP- prefixes. So in order to
remove or add a specific TLS version from the "NORMAL" set use
NORMAL:!VERS-SSL3.0 . To enable
zlib compression use NORMAL:+COMP-DEFLATE .
However it is recommended not to add compression at this level.
With the "NONE" set, in order to be usable, you have to specify a complete
set of combinations of protocol versions, cipher algorithms
(AES-128-CBC), key exchange algorithms (RSA), message authentication
codes (SHA1) and compression methods (COMP-NULL).
All the supported algorithms are:
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). Example Usage:GnuTLSPriorities NORMAL:!AES-256-CBC:!DHE-RSA GnuTLSPriorities EXPORT:!VERS-TLS1.0:+COMP-DEFLATE:+CTYPE-OPENPGP GnuTLSPriorities NONE:+VERS-TLS1.0:+AES-128-CBC:+RSA:+SHA1:+COMP-NULL GnuTLSPriorities NORMAL:+COMP-DEFLATE GnuTLSPriorities NORMAL:%COMPAT GnuTLSPriorities NORMAL:+ANON-DH |