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