github.com/krum110487/go-htaccess@v0.0.0-20240316004156-60641c8e7598/tests/data/apache_2_2_34/conf/extra/httpd-ssl.conf (about)

     1  #
     2  # This is the Apache server configuration file providing SSL support.
     3  # It contains the configuration directives to instruct the server how to
     4  # serve pages over an https connection. For detailed information about these 
     5  # directives see <URL:http://httpd.apache.org/docs/2.2/mod/mod_ssl.html>
     6  # 
     7  # Do NOT simply read the instructions in here without understanding
     8  # what they do.  They're here only as hints or reminders.  If you are unsure
     9  # consult the online docs. You have been warned.  
    10  #
    11  
    12  #
    13  # Pseudo Random Number Generator (PRNG):
    14  # Configure one or more sources to seed the PRNG of the SSL library.
    15  # The seed data should be of good random quality.
    16  # WARNING! On some platforms /dev/random blocks if not enough entropy
    17  # is available. This means you then cannot use the /dev/random device
    18  # because it would lead to very long connection times (as long as
    19  # it requires to make more entropy available). But usually those
    20  # platforms additionally provide a /dev/urandom device which doesn't
    21  # block. So, if available, use this one instead. Read the mod_ssl User
    22  # Manual for more details.
    23  #
    24  #SSLRandomSeed startup file:/dev/random  512
    25  #SSLRandomSeed startup file:/dev/urandom 512
    26  #SSLRandomSeed connect file:/dev/random  512
    27  #SSLRandomSeed connect file:/dev/urandom 512
    28  
    29  
    30  #
    31  # When we also provide SSL we have to listen to the 
    32  # standard HTTP port (see above) and to the HTTPS port
    33  #
    34  # Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
    35  #       Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
    36  #
    37  Listen 443
    38  
    39  ##
    40  ##  SSL Global Context
    41  ##
    42  ##  All SSL configuration in this context applies both to
    43  ##  the main server and all SSL-enabled virtual hosts.
    44  ##
    45  
    46  #
    47  #   Some MIME-types for downloading Certificates and CRLs
    48  #
    49  AddType application/x-x509-ca-cert .crt
    50  AddType application/x-pkcs7-crl    .crl
    51  
    52  #   SSL Cipher Suite:
    53  #   List the ciphers that the client is permitted to negotiate,
    54  #   and that httpd will negotiate as the client of a proxied server.
    55  #   See the OpenSSL documentation for a complete list of ciphers, and
    56  #   ensure these follow appropriate best practices for this deployment.
    57  #   httpd 2.2.30, 2.4.13 and later force-disable aNULL, eNULL and EXP ciphers,
    58  #   while OpenSSL disabled these by default in 0.9.8zf/1.0.0r/1.0.1m/1.0.2a.
    59  SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
    60  SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
    61  
    62  #  By the end of 2016, only TLSv1.2 ciphers should remain in use.
    63  #  Older ciphers should be disallowed as soon as possible, while the
    64  #  kRSA ciphers do not offer forward secrecy.  These changes inhibit
    65  #  older clients (such as IE6 SP2 or IE8 on Windows XP, or other legacy
    66  #  non-browser tooling) from successfully connecting.  
    67  #
    68  #  To restrict mod_ssl to use only TLSv1.2 ciphers, and disable
    69  #  those protocols which do not support forward secrecy, replace
    70  #  the SSLCipherSuite and SSLProxyCipherSuite directives above with
    71  #  the following two directives, as soon as practical.
    72  # SSLCipherSuite HIGH:MEDIUM:!SSLv3:!kRSA
    73  # SSLProxyCipherSuite HIGH:MEDIUM:!SSLv3:!kRSA
    74  
    75  #   User agents such as web browsers are not configured for the user's
    76  #   own preference of either security or performance, therefore this
    77  #   must be the prerogative of the web server administrator who manages
    78  #   cpu load versus confidentiality, so enforce the server's cipher order.
    79  SSLHonorCipherOrder on 
    80  
    81  #   SSL Protocol support:
    82  #   List the protocol versions which clients are allowed to connect with.
    83  #   Disable SSLv2 and SSLv3 by default (cf. RFC 7525 3.1.1).  TLSv1 (1.0)
    84  #   should be disabled as quickly as practical.  By the end of 2016, only
    85  #   the TLSv1.2 protocol or later should remain in use.
    86  SSLProtocol all -SSLv2 -SSLv3
    87  SSLProxyProtocol all -SSLv2 -SSLv3
    88  
    89  #   Pass Phrase Dialog:
    90  #   Configure the pass phrase gathering process.
    91  #   The filtering dialog program (`builtin' is a internal
    92  #   terminal dialog) has to provide the pass phrase on stdout.
    93  SSLPassPhraseDialog  builtin
    94  
    95  #   Inter-Process Session Cache:
    96  #   Configure the SSL Session Cache: First the mechanism 
    97  #   to use and second the expiring timeout (in seconds).
    98  #SSLSessionCache         "dbm:c:/Apache2/logs/ssl_scache"
    99  SSLSessionCache        "shmcb:c:/Apache2/logs/ssl_scache(512000)"
   100  SSLSessionCacheTimeout  300
   101  
   102  #   Semaphore:
   103  #   Configure the path to the mutual exclusion semaphore the
   104  #   SSL engine uses internally for inter-process synchronization. 
   105  SSLMutex default
   106  
   107  ##
   108  ## SSL Virtual Host Context
   109  ##
   110  
   111  <VirtualHost _default_:443>
   112  
   113  #   General setup for the virtual host
   114  DocumentRoot "c:/Apache2/htdocs"
   115  ServerName www.example.com:443
   116  ServerAdmin admin@example.com
   117  ErrorLog "c:/Apache2/logs/error.log"
   118  TransferLog "c:/Apache2/logs/access.log"
   119  
   120  #   SSL Engine Switch:
   121  #   Enable/Disable SSL for this virtual host.
   122  SSLEngine on
   123  
   124  #   Server Certificate:
   125  #   Point SSLCertificateFile at a PEM encoded certificate.  If
   126  #   the certificate is encrypted, then you will be prompted for a
   127  #   pass phrase.  Note that a kill -HUP will prompt again.  Keep
   128  #   in mind that if you have both an RSA and a DSA certificate you
   129  #   can configure both in parallel (to also allow the use of DSA
   130  #   ciphers, etc.)
   131  #   Some ECC cipher suites (http://www.ietf.org/rfc/rfc4492.txt)
   132  #   require an ECC certificate which can also be configured in
   133  #   parallel.
   134  SSLCertificateFile "c:/Apache2/conf/server.crt"
   135  #SSLCertificateFile "c:/Apache2/conf/server-dsa.crt"
   136  #SSLCertificateFile "c:/Apache2/conf/server-ecc.crt"
   137  
   138  #   Server Private Key:
   139  #   If the key is not combined with the certificate, use this
   140  #   directive to point at the key file.  Keep in mind that if
   141  #   you've both a RSA and a DSA private key you can configure
   142  #   both in parallel (to also allow the use of DSA ciphers, etc.)
   143  #   ECC keys, when in use, can also be configured in parallel
   144  SSLCertificateKeyFile "c:/Apache2/conf/server.key"
   145  #SSLCertificateKeyFile "c:/Apache2/conf/server-dsa.key"
   146  #SSLCertificateKeyFile "c:/Apache2/conf/server-ecc.key"
   147  
   148  #   Server Certificate Chain:
   149  #   Point SSLCertificateChainFile at a file containing the
   150  #   concatenation of PEM encoded CA certificates which form the
   151  #   certificate chain for the server certificate. Alternatively
   152  #   the referenced file can be the same as SSLCertificateFile
   153  #   when the CA certificates are directly appended to the server
   154  #   certificate for convenience.
   155  #SSLCertificateChainFile "c:/Apache2/conf/server-ca.crt"
   156  
   157  #   Certificate Authority (CA):
   158  #   Set the CA certificate verification path where to find CA
   159  #   certificates for client authentication or alternatively one
   160  #   huge file containing all of them (file must be PEM encoded)
   161  #   Note: Inside SSLCACertificatePath you need hash symlinks
   162  #         to point to the certificate files. Use the provided
   163  #         Makefile to update the hash symlinks after changes.
   164  #SSLCACertificatePath "c:/Apache2/conf/ssl.crt"
   165  #SSLCACertificateFile "c:/Apache2/conf/ssl.crt/ca-bundle.crt"
   166  
   167  #   Certificate Revocation Lists (CRL):
   168  #   Set the CA revocation path where to find CA CRLs for client
   169  #   authentication or alternatively one huge file containing all
   170  #   of them (file must be PEM encoded)
   171  #   Note: Inside SSLCARevocationPath you need hash symlinks
   172  #         to point to the certificate files. Use the provided
   173  #         Makefile to update the hash symlinks after changes.
   174  #SSLCARevocationPath "c:/Apache2/conf/ssl.crl"
   175  #SSLCARevocationFile "c:/Apache2/conf/ssl.crl/ca-bundle.crl"
   176  
   177  #   Client Authentication (Type):
   178  #   Client certificate verification type and depth.  Types are
   179  #   none, optional, require and optional_no_ca.  Depth is a
   180  #   number which specifies how deeply to verify the certificate
   181  #   issuer chain before deciding the certificate is not valid.
   182  #SSLVerifyClient require
   183  #SSLVerifyDepth  10
   184  
   185  #   Access Control:
   186  #   With SSLRequire you can do per-directory access control based
   187  #   on arbitrary complex boolean expressions containing server
   188  #   variable checks and other lookup directives.  The syntax is a
   189  #   mixture between C and Perl.  See the mod_ssl documentation
   190  #   for more details.
   191  #<Location />
   192  #SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
   193  #            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
   194  #            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
   195  #            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
   196  #            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
   197  #           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
   198  #</Location>
   199  
   200  #   SSL Engine Options:
   201  #   Set various options for the SSL engine.
   202  #   o FakeBasicAuth:
   203  #     Translate the client X.509 into a Basic Authorisation.  This means that
   204  #     the standard Auth/DBMAuth methods can be used for access control.  The
   205  #     user name is the `one line' version of the client's X.509 certificate.
   206  #     Note that no password is obtained from the user. Every entry in the user
   207  #     file needs this password: `xxj31ZMTZzkVA'.
   208  #   o ExportCertData:
   209  #     This exports two additional environment variables: SSL_CLIENT_CERT and
   210  #     SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
   211  #     server (always existing) and the client (only existing when client
   212  #     authentication is used). This can be used to import the certificates
   213  #     into CGI scripts.
   214  #   o StdEnvVars:
   215  #     This exports the standard SSL/TLS related `SSL_*' environment variables.
   216  #     Per default this exportation is switched off for performance reasons,
   217  #     because the extraction step is an expensive operation and is usually
   218  #     useless for serving static content. So one usually enables the
   219  #     exportation for CGI and SSI requests only.
   220  #   o StrictRequire:
   221  #     This denies access when "SSLRequireSSL" or "SSLRequire" applied even
   222  #     under a "Satisfy any" situation, i.e. when it applies access is denied
   223  #     and no other module can change it.
   224  #   o OptRenegotiate:
   225  #     This enables optimized SSL connection renegotiation handling when SSL
   226  #     directives are used in per-directory context. 
   227  #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
   228  <FilesMatch "\.(cgi|shtml|phtml|php)$">
   229      SSLOptions +StdEnvVars
   230  </FilesMatch>
   231  <Directory "c:/Apache2/cgi-bin">
   232      SSLOptions +StdEnvVars
   233  </Directory>
   234  
   235  #   SSL Protocol Adjustments:
   236  #   The safe and default but still SSL/TLS standard compliant shutdown
   237  #   approach is that mod_ssl sends the close notify alert but doesn't wait for
   238  #   the close notify alert from client. When you need a different shutdown
   239  #   approach you can use one of the following variables:
   240  #   o ssl-unclean-shutdown:
   241  #     This forces an unclean shutdown when the connection is closed, i.e. no
   242  #     SSL close notify alert is sent or allowed to be received.  This violates
   243  #     the SSL/TLS standard but is needed for some brain-dead browsers. Use
   244  #     this when you receive I/O errors because of the standard approach where
   245  #     mod_ssl sends the close notify alert.
   246  #   o ssl-accurate-shutdown:
   247  #     This forces an accurate shutdown when the connection is closed, i.e. a
   248  #     SSL close notify alert is send and mod_ssl waits for the close notify
   249  #     alert of the client. This is 100% SSL/TLS standard compliant, but in
   250  #     practice often causes hanging connections with brain-dead browsers. Use
   251  #     this only for browsers where you know that their SSL implementation
   252  #     works correctly. 
   253  #   Notice: Most problems of broken clients are also related to the HTTP
   254  #   keep-alive facility, so you usually additionally want to disable
   255  #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
   256  #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
   257  #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
   258  #   "force-response-1.0" for this.
   259  BrowserMatch "MSIE [2-5]" \
   260           nokeepalive ssl-unclean-shutdown \
   261           downgrade-1.0 force-response-1.0
   262  
   263  #   Per-Server Logging:
   264  #   The home of a custom SSL log file. Use this when you want a
   265  #   compact non-error SSL logfile on a virtual host basis.
   266  CustomLog "c:/Apache2/logs/ssl_request.log" \
   267            "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
   268  
   269  </VirtualHost>