cvsdist 3cbd43b
#
cvsdist 3cbd43b
# When we also provide SSL we have to listen to the 
9f9ccbc
# the HTTPS port in addition.
cvsdist 3cbd43b
#
3a44ff7
Listen 443 https
cvsdist 3cbd43b
cvsdist 3cbd43b
##
cvsdist 3cbd43b
##  SSL Global Context
cvsdist 3cbd43b
##
cvsdist 3cbd43b
##  All SSL configuration in this context applies both to
cvsdist 3cbd43b
##  the main server and all SSL-enabled virtual hosts.
cvsdist 3cbd43b
##
cvsdist 3cbd43b
cvsdist 3cbd43b
#   Pass Phrase Dialog:
cvsdist 3cbd43b
#   Configure the pass phrase gathering process.
cvsdist 3cbd43b
#   The filtering dialog program (`builtin' is a internal
cvsdist 3cbd43b
#   terminal dialog) has to provide the pass phrase on stdout.
Jan Kaluza 2673a43
SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
cvsdist 3cbd43b
cvsdist 3cbd43b
#   Inter-Process Session Cache:
cvsdist 3cbd43b
#   Configure the SSL Session Cache: First the mechanism 
cvsdist 3cbd43b
#   to use and second the expiring timeout (in seconds).
ef68bba
SSLSessionCache         shmcb:/run/httpd/sslcache(512000)
cvsdist 3cbd43b
SSLSessionCacheTimeout  300
cvsdist 3cbd43b
cvsdist 3cbd43b
#   Pseudo Random Number Generator (PRNG):
cvsdist 3cbd43b
#   Configure one or more sources to seed the PRNG of the 
cvsdist 3cbd43b
#   SSL library. The seed data should be of good random quality.
cvsdist 3cbd43b
#   WARNING! On some platforms /dev/random blocks if not enough entropy
cvsdist 3cbd43b
#   is available. This means you then cannot use the /dev/random device
cvsdist 3cbd43b
#   because it would lead to very long connection times (as long as
cvsdist 3cbd43b
#   it requires to make more entropy available). But usually those
cvsdist 3cbd43b
#   platforms additionally provide a /dev/urandom device which doesn't
cvsdist 3cbd43b
#   block. So, if available, use this one instead. Read the mod_ssl User
cvsdist 3cbd43b
#   Manual for more details.
cvsdist b895f53
SSLRandomSeed startup file:/dev/urandom  256
cvsdist 3cbd43b
SSLRandomSeed connect builtin
cvsdist 3cbd43b
#SSLRandomSeed startup file:/dev/random  512
cvsdist 3cbd43b
#SSLRandomSeed connect file:/dev/random  512
cvsdist 3cbd43b
#SSLRandomSeed connect file:/dev/urandom 512
cvsdist 3cbd43b
cvsdist d48e904
#
cvsdist d48e904
# Use "SSLCryptoDevice" to enable any supported hardware
cvsdist d48e904
# accelerators. Use "openssl engine -v" to list supported
cvsdist d48e904
# engine names.  NOTE: If you enable an accelerator and the
cvsdist d48e904
# server does not start, consult the error logs and ensure
cvsdist d48e904
# your accelerator is functioning properly. 
cvsdist d48e904
#
cvsdist d48e904
SSLCryptoDevice builtin
cvsdist d48e904
#SSLCryptoDevice ubsec
cvsdist d48e904
cvsdist 3cbd43b
##
cvsdist 3cbd43b
## SSL Virtual Host Context
cvsdist 3cbd43b
##
cvsdist 3cbd43b
cvsdist 3cbd43b
<VirtualHost _default_:443>
cvsdist 3cbd43b
cvsdist b895f53
# General setup for the virtual host, inherited from global configuration
cvsdist d48e904
#DocumentRoot "/var/www/html"
cvsdist b895f53
#ServerName www.example.com:443
cvsdist d48e904
cvsdist b895f53
# Use separate log files for the SSL virtual host; note that LogLevel
cvsdist b895f53
# is not inherited from httpd.conf.
cvsdist 3cbd43b
ErrorLog logs/ssl_error_log
cvsdist 3cbd43b
TransferLog logs/ssl_access_log
cvsdist b895f53
LogLevel warn
cvsdist 3cbd43b
cvsdist 3cbd43b
#   SSL Engine Switch:
cvsdist 3cbd43b
#   Enable/Disable SSL for this virtual host.
cvsdist 3cbd43b
SSLEngine on
cvsdist 3cbd43b
91a2788
#   List the protocol versions which clients are allowed to connect with.
91a2788
#   Disable SSLv3 by default (cf. RFC 7525 3.1.1).  TLSv1 (1.0) should be
91a2788
#   disabled as quickly as practical.  By the end of 2016, only the TLSv1.2
91a2788
#   protocol or later should remain in use.
91a2788
SSLProtocol all -SSLv3
91a2788
SSLProxyProtocol all -SSLv3
91a2788
91a2788
#   User agents such as web browsers are not configured for the user's
91a2788
#   own preference of either security or performance, therefore this
91a2788
#   must be the prerogative of the web server administrator who manages
91a2788
#   cpu load versus confidentiality, so enforce the server's cipher order.
91a2788
SSLHonorCipherOrder on
9d36ace
cvsdist 3cbd43b
#   SSL Cipher Suite:
c0bdfa4
# List the ciphers that the client is permitted to negotiate.
c0bdfa4
# See the mod_ssl documentation for a complete list.
4475e3e
# The OpenSSL system profile is configured by default.  See
4475e3e
# update-crypto-policies(8) for more details.
793563a
SSLCipherSuite PROFILE=SYSTEM
91a2788
SSLProxyCipherSuite PROFILE=SYSTEM
cvsdist 3cbd43b
60e3fdb
#   Point SSLCertificateFile at a PEM encoded certificate.  If
60e3fdb
#   the certificate is encrypted, then you will be prompted for a
60e3fdb
#   pass phrase.  Note that restarting httpd will prompt again.  Keep
60e3fdb
#   in mind that if you have both an RSA and a DSA certificate you
60e3fdb
#   can configure both in parallel (to also allow the use of DSA
60e3fdb
#   ciphers, etc.)
60e3fdb
#   Some ECC cipher suites (http://www.ietf.org/rfc/rfc4492.txt)
60e3fdb
#   require an ECC certificate which can also be configured in
60e3fdb
#   parallel.
06872c8
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
cvsdist 3cbd43b
cvsdist 3cbd43b
#   Server Private Key:
cvsdist 3cbd43b
#   If the key is not combined with the certificate, use this
cvsdist 3cbd43b
#   directive to point at the key file.  Keep in mind that if
cvsdist 3cbd43b
#   you've both a RSA and a DSA private key you can configure
cvsdist 3cbd43b
#   both in parallel (to also allow the use of DSA ciphers, etc.)
60e3fdb
#   ECC keys, when in use, can also be configured in parallel
06872c8
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
cvsdist 3cbd43b
cvsdist 3cbd43b
#   Server Certificate Chain:
cvsdist 3cbd43b
#   Point SSLCertificateChainFile at a file containing the
cvsdist 3cbd43b
#   concatenation of PEM encoded CA certificates which form the
cvsdist 3cbd43b
#   certificate chain for the server certificate. Alternatively
cvsdist 3cbd43b
#   the referenced file can be the same as SSLCertificateFile
cvsdist 3cbd43b
#   when the CA certificates are directly appended to the server
60e3fdb
#   certificate for convenience.
06872c8
#SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt
cvsdist 3cbd43b
cvsdist 3cbd43b
#   Certificate Authority (CA):
cvsdist 3cbd43b
#   Set the CA certificate verification path where to find CA
cvsdist 3cbd43b
#   certificates for client authentication or alternatively one
cvsdist 3cbd43b
#   huge file containing all of them (file must be PEM encoded)
06872c8
#SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
cvsdist 3cbd43b
cvsdist 3cbd43b
#   Client Authentication (Type):
cvsdist 3cbd43b
#   Client certificate verification type and depth.  Types are
cvsdist 3cbd43b
#   none, optional, require and optional_no_ca.  Depth is a
cvsdist 3cbd43b
#   number which specifies how deeply to verify the certificate
cvsdist 3cbd43b
#   issuer chain before deciding the certificate is not valid.
cvsdist 3cbd43b
#SSLVerifyClient require
cvsdist 3cbd43b
#SSLVerifyDepth  10
cvsdist 3cbd43b
cvsdist 3cbd43b
#   Access Control:
cvsdist 3cbd43b
#   With SSLRequire you can do per-directory access control based
cvsdist 3cbd43b
#   on arbitrary complex boolean expressions containing server
cvsdist 3cbd43b
#   variable checks and other lookup directives.  The syntax is a
cvsdist 3cbd43b
#   mixture between C and Perl.  See the mod_ssl documentation
cvsdist 3cbd43b
#   for more details.
cvsdist 3cbd43b
#<Location />
cvsdist 3cbd43b
#SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
cvsdist 3cbd43b
#            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
cvsdist 3cbd43b
#            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
cvsdist 3cbd43b
#            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
cvsdist 3cbd43b
#            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
cvsdist 3cbd43b
#           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
cvsdist 3cbd43b
#</Location>
cvsdist 3cbd43b
cvsdist 3cbd43b
#   SSL Engine Options:
cvsdist 3cbd43b
#   Set various options for the SSL engine.
cvsdist 3cbd43b
#   o FakeBasicAuth:
cvsdist 3cbd43b
#     Translate the client X.509 into a Basic Authorisation.  This means that
cvsdist 3cbd43b
#     the standard Auth/DBMAuth methods can be used for access control.  The
cvsdist 3cbd43b
#     user name is the `one line' version of the client's X.509 certificate.
cvsdist 3cbd43b
#     Note that no password is obtained from the user. Every entry in the user
cvsdist 3cbd43b
#     file needs this password: `xxj31ZMTZzkVA'.
cvsdist 3cbd43b
#   o ExportCertData:
cvsdist 3cbd43b
#     This exports two additional environment variables: SSL_CLIENT_CERT and
cvsdist 3cbd43b
#     SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
cvsdist 3cbd43b
#     server (always existing) and the client (only existing when client
cvsdist 3cbd43b
#     authentication is used). This can be used to import the certificates
cvsdist 3cbd43b
#     into CGI scripts.
cvsdist 3cbd43b
#   o StdEnvVars:
cvsdist 3cbd43b
#     This exports the standard SSL/TLS related `SSL_*' environment variables.
cvsdist 3cbd43b
#     Per default this exportation is switched off for performance reasons,
cvsdist 3cbd43b
#     because the extraction step is an expensive operation and is usually
cvsdist 3cbd43b
#     useless for serving static content. So one usually enables the
cvsdist 3cbd43b
#     exportation for CGI and SSI requests only.
cvsdist 3cbd43b
#   o StrictRequire:
cvsdist 3cbd43b
#     This denies access when "SSLRequireSSL" or "SSLRequire" applied even
cvsdist 3cbd43b
#     under a "Satisfy any" situation, i.e. when it applies access is denied
cvsdist 3cbd43b
#     and no other module can change it.
cvsdist 3cbd43b
#   o OptRenegotiate:
cvsdist 3cbd43b
#     This enables optimized SSL connection renegotiation handling when SSL
cvsdist 3cbd43b
#     directives are used in per-directory context. 
06872c8
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
60e3fdb
<FilesMatch "\.(cgi|shtml|phtml|php)$">
cvsdist 3cbd43b
    SSLOptions +StdEnvVars
60e3fdb
</FilesMatch>
cvsdist 3cbd43b
<Directory "/var/www/cgi-bin">
cvsdist 3cbd43b
    SSLOptions +StdEnvVars
cvsdist 3cbd43b
</Directory>
cvsdist 3cbd43b
cvsdist 3cbd43b
#   SSL Protocol Adjustments:
cvsdist 3cbd43b
#   The safe and default but still SSL/TLS standard compliant shutdown
cvsdist 3cbd43b
#   approach is that mod_ssl sends the close notify alert but doesn't wait for
cvsdist 3cbd43b
#   the close notify alert from client. When you need a different shutdown
cvsdist 3cbd43b
#   approach you can use one of the following variables:
cvsdist 3cbd43b
#   o ssl-unclean-shutdown:
cvsdist 3cbd43b
#     This forces an unclean shutdown when the connection is closed, i.e. no
60e3fdb
#     SSL close notify alert is sent or allowed to be received.  This violates
cvsdist 3cbd43b
#     the SSL/TLS standard but is needed for some brain-dead browsers. Use
cvsdist 3cbd43b
#     this when you receive I/O errors because of the standard approach where
cvsdist 3cbd43b
#     mod_ssl sends the close notify alert.
cvsdist 3cbd43b
#   o ssl-accurate-shutdown:
cvsdist 3cbd43b
#     This forces an accurate shutdown when the connection is closed, i.e. a
60e3fdb
#     SSL close notify alert is sent and mod_ssl waits for the close notify
cvsdist 3cbd43b
#     alert of the client. This is 100% SSL/TLS standard compliant, but in
cvsdist 3cbd43b
#     practice often causes hanging connections with brain-dead browsers. Use
cvsdist 3cbd43b
#     this only for browsers where you know that their SSL implementation
cvsdist 3cbd43b
#     works correctly. 
cvsdist 3cbd43b
#   Notice: Most problems of broken clients are also related to the HTTP
cvsdist 3cbd43b
#   keep-alive facility, so you usually additionally want to disable
cvsdist 3cbd43b
#   keep-alive for those clients, too. Use variable "nokeepalive" for this.
cvsdist 3cbd43b
#   Similarly, one has to force some clients to use HTTP/1.0 to workaround
cvsdist 3cbd43b
#   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
cvsdist 3cbd43b
#   "force-response-1.0" for this.
3a44ff7
BrowserMatch "MSIE [2-5]" \
cvsdist 3cbd43b
         nokeepalive ssl-unclean-shutdown \
cvsdist 3cbd43b
         downgrade-1.0 force-response-1.0
cvsdist 3cbd43b
cvsdist 3cbd43b
#   Per-Server Logging:
cvsdist 3cbd43b
#   The home of a custom SSL log file. Use this when you want a
cvsdist 3cbd43b
#   compact non-error SSL logfile on a virtual host basis.
cvsdist 3cbd43b
CustomLog logs/ssl_request_log \
cvsdist 3cbd43b
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
cvsdist 3cbd43b
cvsdist 3cbd43b
</VirtualHost>                                  
cvsdist 3cbd43b