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