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