Saltstack Official Apache Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

211 lines
9.8KB

  1. ##
  2. ## SSL Global Context
  3. ##
  4. ## All SSL configuration in this context applies both to
  5. ## the main server and all SSL-enabled virtual hosts.
  6. ##
  7. # Pass Phrase Dialog:
  8. # Configure the pass phrase gathering process.
  9. # The filtering dialog program (`builtin' is a internal
  10. # terminal dialog) has to provide the pass phrase on stdout.
  11. SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
  12. # Inter-Process Session Cache:
  13. # Configure the SSL Session Cache: First the mechanism
  14. # to use and second the expiring timeout (in seconds).
  15. SSLSessionCache shmcb:/run/httpd/sslcache(512000)
  16. SSLSessionCacheTimeout 300
  17. # Pseudo Random Number Generator (PRNG):
  18. # Configure one or more sources to seed the PRNG of the
  19. # SSL library. The seed data should be of good random quality.
  20. # WARNING! On some platforms /dev/random blocks if not enough entropy
  21. # is available. This means you then cannot use the /dev/random device
  22. # because it would lead to very long connection times (as long as
  23. # it requires to make more entropy available). But usually those
  24. # platforms additionally provide a /dev/urandom device which doesn't
  25. # block. So, if available, use this one instead. Read the mod_ssl User
  26. # Manual for more details.
  27. SSLRandomSeed startup file:/dev/urandom 256
  28. SSLRandomSeed connect builtin
  29. #SSLRandomSeed startup file:/dev/random 512
  30. #SSLRandomSeed connect file:/dev/random 512
  31. #SSLRandomSeed connect file:/dev/urandom 512
  32. #
  33. # Use "SSLCryptoDevice" to enable any supported hardware
  34. # accelerators. Use "openssl engine -v" to list supported
  35. # engine names. NOTE: If you enable an accelerator and the
  36. # server does not start, consult the error logs and ensure
  37. # your accelerator is functioning properly.
  38. #
  39. SSLCryptoDevice builtin
  40. #SSLCryptoDevice ubsec
  41. ##
  42. ## SSL Virtual Host Context
  43. ##
  44. <VirtualHost _default_:443>
  45. # General setup for the virtual host, inherited from global configuration
  46. #DocumentRoot "/var/www/html"
  47. #ServerName www.example.com:443
  48. # Use separate log files for the SSL virtual host; note that LogLevel
  49. # is not inherited from httpd.conf.
  50. ErrorLog logs/ssl_error_log
  51. TransferLog logs/ssl_access_log
  52. LogLevel warn
  53. # SSL Engine Switch:
  54. # Enable/Disable SSL for this virtual host.
  55. SSLEngine on
  56. # SSL Protocol support:
  57. # List the enable protocol levels with which clients will be able to
  58. # connect. Disable SSLv2 access by default:
  59. SSLProtocol all -SSLv2 -SSLv3
  60. # SSL Cipher Suite:
  61. # List the ciphers that the client is permitted to negotiate.
  62. # See the mod_ssl documentation for a complete list.
  63. SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:!SEED:!IDEA
  64. # Speed-optimized SSL Cipher configuration:
  65. # If speed is your main concern (on busy HTTPS servers e.g.),
  66. # you might want to force clients to specific, performance
  67. # optimized ciphers. In this case, prepend those ciphers
  68. # to the SSLCipherSuite list, and enable SSLHonorCipherOrder.
  69. # Caveat: by giving precedence to RC4-SHA and AES128-SHA
  70. # (as in the example below), most connections will no longer
  71. # have perfect forward secrecy - if the server's key is
  72. # compromised, captures of past or future traffic must be
  73. # considered compromised, too.
  74. #SSLCipherSuite RC4-SHA:AES128-SHA:HIGH:MEDIUM:!aNULL:!MD5
  75. #SSLHonorCipherOrder on
  76. # Server Certificate:
  77. # Point SSLCertificateFile at a PEM encoded certificate. If
  78. # the certificate is encrypted, then you will be prompted for a
  79. # pass phrase. Note that a kill -HUP will prompt again. A new
  80. # certificate can be generated using the genkey(1) command.
  81. SSLCertificateFile /etc/pki/tls/certs/localhost.crt
  82. # Server Private Key:
  83. # If the key is not combined with the certificate, use this
  84. # directive to point at the key file. Keep in mind that if
  85. # you've both a RSA and a DSA private key you can configure
  86. # both in parallel (to also allow the use of DSA ciphers, etc.)
  87. SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
  88. # Server Certificate Chain:
  89. # Point SSLCertificateChainFile at a file containing the
  90. # concatenation of PEM encoded CA certificates which form the
  91. # certificate chain for the server certificate. Alternatively
  92. # the referenced file can be the same as SSLCertificateFile
  93. # when the CA certificates are directly appended to the server
  94. # certificate for convinience.
  95. #SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt
  96. # Certificate Authority (CA):
  97. # Set the CA certificate verification path where to find CA
  98. # certificates for client authentication or alternatively one
  99. # huge file containing all of them (file must be PEM encoded)
  100. #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
  101. # Client Authentication (Type):
  102. # Client certificate verification type and depth. Types are
  103. # none, optional, require and optional_no_ca. Depth is a
  104. # number which specifies how deeply to verify the certificate
  105. # issuer chain before deciding the certificate is not valid.
  106. #SSLVerifyClient require
  107. #SSLVerifyDepth 10
  108. # Access Control:
  109. # With SSLRequire you can do per-directory access control based
  110. # on arbitrary complex boolean expressions containing server
  111. # variable checks and other lookup directives. The syntax is a
  112. # mixture between C and Perl. See the mod_ssl documentation
  113. # for more details.
  114. #<Location />
  115. #SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
  116. # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
  117. # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
  118. # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
  119. # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
  120. # or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
  121. #</Location>
  122. # SSL Engine Options:
  123. # Set various options for the SSL engine.
  124. # o FakeBasicAuth:
  125. # Translate the client X.509 into a Basic Authorisation. This means that
  126. # the standard Auth/DBMAuth methods can be used for access control. The
  127. # user name is the `one line' version of the client's X.509 certificate.
  128. # Note that no password is obtained from the user. Every entry in the user
  129. # file needs this password: `xxj31ZMTZzkVA'.
  130. # o ExportCertData:
  131. # This exports two additional environment variables: SSL_CLIENT_CERT and
  132. # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
  133. # server (always existing) and the client (only existing when client
  134. # authentication is used). This can be used to import the certificates
  135. # into CGI scripts.
  136. # o StdEnvVars:
  137. # This exports the standard SSL/TLS related `SSL_*' environment variables.
  138. # Per default this exportation is switched off for performance reasons,
  139. # because the extraction step is an expensive operation and is usually
  140. # useless for serving static content. So one usually enables the
  141. # exportation for CGI and SSI requests only.
  142. # o StrictRequire:
  143. # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
  144. # under a "Satisfy any" situation, i.e. when it applies access is denied
  145. # and no other module can change it.
  146. # o OptRenegotiate:
  147. # This enables optimized SSL connection renegotiation handling when SSL
  148. # directives are used in per-directory context.
  149. #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
  150. <Files ~ "\.(cgi|shtml|phtml|php3?)$">
  151. SSLOptions +StdEnvVars
  152. </Files>
  153. <Directory "/var/www/cgi-bin">
  154. SSLOptions +StdEnvVars
  155. </Directory>
  156. # SSL Protocol Adjustments:
  157. # The safe and default but still SSL/TLS standard compliant shutdown
  158. # approach is that mod_ssl sends the close notify alert but doesn't wait for
  159. # the close notify alert from client. When you need a different shutdown
  160. # approach you can use one of the following variables:
  161. # o ssl-unclean-shutdown:
  162. # This forces an unclean shutdown when the connection is closed, i.e. no
  163. # SSL close notify alert is send or allowed to received. This violates
  164. # the SSL/TLS standard but is needed for some brain-dead browsers. Use
  165. # this when you receive I/O errors because of the standard approach where
  166. # mod_ssl sends the close notify alert.
  167. # o ssl-accurate-shutdown:
  168. # This forces an accurate shutdown when the connection is closed, i.e. a
  169. # SSL close notify alert is send and mod_ssl waits for the close notify
  170. # alert of the client. This is 100% SSL/TLS standard compliant, but in
  171. # practice often causes hanging connections with brain-dead browsers. Use
  172. # this only for browsers where you know that their SSL implementation
  173. # works correctly.
  174. # Notice: Most problems of broken clients are also related to the HTTP
  175. # keep-alive facility, so you usually additionally want to disable
  176. # keep-alive for those clients, too. Use variable "nokeepalive" for this.
  177. # Similarly, one has to force some clients to use HTTP/1.0 to workaround
  178. # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
  179. # "force-response-1.0" for this.
  180. BrowserMatch "MSIE [2-5]" \
  181. nokeepalive ssl-unclean-shutdown \
  182. downgrade-1.0 force-response-1.0
  183. # Per-Server Logging:
  184. # The home of a custom SSL log file. Use this when you want a
  185. # compact non-error SSL logfile on a virtual host basis.
  186. CustomLog logs/ssl_request_log \
  187. "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
  188. </VirtualHost>