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