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