2 #SSLStaplingCache shmcb:/var/cache/apache2/ssl_stapling_cache(256000)
6 <Macro HTTP2HTTPS $domain>
9 # Apparently you need the rewrite engine to implement
10 # a simple "redirect all except for..." policy. Amazing.
12 # Do *not* redirect the acme-challenge dir to https, since otherwise the
13 # challenge cannot be fetched when there is no certificate yet for this domain.
14 RewriteRule ^/\.well-known/acme-challenge/(.*) /srv/acme-challenge/$1 [L]
15 # Make the upgrade to HTTPS a "permanent" redirect.
16 RewriteRule ^/(.*) https://$domain/$1 [R=301,L]
23 # Use HTTP Strict Transport Security to force client to use secure connections only
24 Header unset Strict-Transport-Security
25 Header set Strict-Transport-Security "max-age=864000"
26 # Make sure we load everything via HTTPS
27 Header add Content-Security-Policy "upgrade-insecure-requests"
29 #########################################################
30 # SSL configuration below ###############################
31 #########################################################
33 # Enable/Disable SSL for this virtual host.
36 # configure SSL ciphers and protocols
37 SSLProtocol All -SSLv2 -SSLv3
38 # TODO: Once OpenSSL supports GCM with more than just AES, revisit this
39 # NOTE: The reason we support non-FS ciphers is stupid middleboxes like the one used by Frauenhofer in SB, that don't support FS
40 SSLCipherSuite 'kEECDH+AESGCM:kEDH+AESGCM:kEECDH:kEDH:AESGCM:ALL:!3DES:!EXPORT:!LOW:!MEDIUM:!aNULL:!eNULL'
41 SSLHonorCipherOrder on
44 SSLOpenSSLConfCmd DHParameters "/etc/ssl/dh2048.pem"
47 SSLCertificateFile /etc/ssl/mycerts/$cert.crt
48 SSLCertificateKeyFile /etc/ssl/private/$cert.key
50 # Server Certificate Chain:
51 # Point SSLCertificateChainFile at a file containing the
52 # concatenation of PEM encoded CA certificates which form the
53 # certificate chain for the server certificate. Alternatively
54 # the referenced file can be the same as SSLCertificateFile
55 # when the CA certificates are directly appended to the server
56 # certificate for convinience.
57 SSLCertificateChainFile /etc/ssl/mycerts/$cert.crt
59 # Certificate Authority (CA):
60 # Set the CA certificate verification path where to find CA
61 # certificates for client authentication or alternatively one
62 # huge file containing all of them (file must be PEM encoded)
63 # Note: Inside SSLCACertificatePath you need hash symlinks
64 # to point to the certificate files. Use the provided
65 # Makefile to update the hash symlinks after changes.
66 #SSLCACertificatePath /etc/ssl/certs/
67 #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
69 # Certificate Revocation Lists (CRL):
70 # Set the CA revocation path where to find CA CRLs for client
71 # authentication or alternatively one huge file containing all
72 # of them (file must be PEM encoded)
73 # Note: Inside SSLCARevocationPath you need hash symlinks
74 # to point to the certificate files. Use the provided
75 # Makefile to update the hash symlinks after changes.
76 #SSLCARevocationPath /etc/apache2/ssl.crl/
77 #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
79 # Client Authentication (Type):
80 # Client certificate verification type and depth. Types are
81 # none, optional, require and optional_no_ca. Depth is a
82 # number which specifies how deeply to verify the certificate
83 # issuer chain before deciding the certificate is not valid.
84 #SSLVerifyClient require
88 # With SSLRequire you can do per-directory access control based
89 # on arbitrary complex boolean expressions containing server
90 # variable checks and other lookup directives. The syntax is a
91 # mixture between C and Perl. See the mod_ssl documentation
94 #SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
95 # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
96 # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
97 # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
98 # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
99 # or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
102 # SSL Engine Options:
103 # Set various options for the SSL engine.
105 # Translate the client X.509 into a Basic Authorisation. This means that
106 # the standard Auth/DBMAuth methods can be used for access control. The
107 # user name is the `one line' version of the client's X.509 certificate.
108 # Note that no password is obtained from the user. Every entry in the user
109 # file needs this password: `xxj31ZMTZzkVA'.
111 # This exports two additional environment variables: SSL_CLIENT_CERT and
112 # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
113 # server (always existing) and the client (only existing when client
114 # authentication is used). This can be used to import the certificates
117 # This exports the standard SSL/TLS related `SSL_*' environment variables.
118 # Per default this exportation is switched off for performance reasons,
119 # because the extraction step is an expensive operation and is usually
120 # useless for serving static content. So one usually enables the
121 # exportation for CGI and SSI requests only.
123 # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
124 # under a "Satisfy any" situation, i.e. when it applies access is denied
125 # and no other module can change it.
127 # This enables optimized SSL connection renegotiation handling when SSL
128 # directives are used in per-directory context.
129 #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
130 #<FilesMatch "\.(cgi|shtml|phtml|php)$">
131 # SSLOptions +StdEnvVars
133 #<Directory /usr/lib/cgi-bin>
134 # SSLOptions +StdEnvVars
137 # SSL Protocol Adjustments:
138 # The safe and default but still SSL/TLS standard compliant shutdown
139 # approach is that mod_ssl sends the close notify alert but doesn't wait for
140 # the close notify alert from client. When you need a different shutdown
141 # approach you can use one of the following variables:
142 # o ssl-unclean-shutdown:
143 # This forces an unclean shutdown when the connection is closed, i.e. no
144 # SSL close notify alert is send or allowed to received. This violates
145 # the SSL/TLS standard but is needed for some brain-dead browsers. Use
146 # this when you receive I/O errors because of the standard approach where
147 # mod_ssl sends the close notify alert.
148 # o ssl-accurate-shutdown:
149 # This forces an accurate shutdown when the connection is closed, i.e. a
150 # SSL close notify alert is send and mod_ssl waits for the close notify
151 # alert of the client. This is 100% SSL/TLS standard compliant, but in
152 # practice often causes hanging connections with brain-dead browsers. Use
153 # this only for browsers where you know that their SSL implementation
155 # Notice: Most problems of broken clients are also related to the HTTP
156 # keep-alive facility, so you usually additionally want to disable
157 # keep-alive for those clients, too. Use variable "nokeepalive" for this.
158 # Similarly, one has to force some clients to use HTTP/1.0 to workaround
159 # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
160 # "force-response-1.0" for this.
161 #BrowserMatch "MSIE [2-6]" \
162 # nokeepalive ssl-unclean-shutdown \
163 # downgrade-1.0 force-response-1.0
164 # MSIE 7 and newer should be able to use keepalive
165 #BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown