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