Commit Graph

139 Commits

Author SHA1 Message Date
6a0896d693 *) mod_heartmonitor: Set the documented default value
"10" for HeartbeatMaxServers instead of "0". With "0"
     no shared memory slotmem was initialized. [Rainer Jung]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900026 13f79535-47bb-0310-9956-ffa450edef68
2022-04-19 08:59:47 +00:00
716d664f7d * Add Changelog for r1899451, r1899454, r1899562, r1899564, r1899584
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899886 13f79535-47bb-0310-9956-ffa450edef68
2022-04-15 11:42:58 +00:00
5d3b2f1f0c *) mod_http2: use the new REQUEST buckets to forward request
on secondary connections. Use the now generic
     ap_process_connection() in h2 workers to process those.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899802 13f79535-47bb-0310-9956-ffa450edef68
2022-04-13 08:38:12 +00:00
fbb84e00fa Merge PR 311:
*) core/mod_http: use REQUEST meta buckets and a new HTTP/1.x specific
     input filter to separate the handling for HTTP requests from the
     handling of HTTP/1.x request parsing and checks.
     A new HTTP1_REQUEST_IN filter installs itself on http/1.1 connections
     before a request is being read. It generates either a REQUEST meta
     bucket on success or an ERROR bucket with the proposed response status.
     The core connection processing, relying on ap_read_request(), now expects
     a REQUEST or ERROR bucket from the input filters and is agnostic to
     specific HTTP versions and how they bring requests into the server.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899799 13f79535-47bb-0310-9956-ffa450edef68
2022-04-13 07:40:17 +00:00
d150ca6f4e Follow up to r1899777: CHANGES entry [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899786 13f79535-47bb-0310-9956-ffa450edef68
2022-04-12 17:43:20 +00:00
0296d7dfea *) core/mod_http: use RESPONSE meta buckets and a new HTTP/1.x specific
filter to send responses through the output filter chain.
     Specifically: the HTTP_HEADER output filter and ap_send_interim_response()
     create a RESPONSE bucket and no longer are concerned with HTTP/1.x
     serialization.
     A new HTTP1_RESPONSE_OUT transcode filter writes the proper HTTP/1.x
     bytes when dealing with a RESPONSE bucket. That filter installs itself
     on the pre_read_request hook when the connection has protocol 'http/1.1'.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899648 13f79535-47bb-0310-9956-ffa450edef68
2022-04-07 10:41:46 +00:00
a4ea0e7799 *) core: make ap_escape_quotes() work correctly on strings
with more than MAX_INT/2 characters, counting quotes double.
     Credit to <generalbugs@zippenhop.com> for finding this.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899609 13f79535-47bb-0310-9956-ffa450edef68
2022-04-06 09:17:42 +00:00
6bd9d17e08 *) core: adding a new hook and method to the API:
create_secondary_connection and ap_create_secondary_connection()
     to setup connections related to a "master" one, as used in
     the HTTP/2 protocol implementation.

  *) mod_http2: using the new API calls to get rid of knowledge
     about how the core handles conn_rec specifics.
     Improvements in pollset stream handling to use less sets.
     Using atomic read/writes instead of volatiles now.
     Keeping a reserve of "transit" pools and bucket_allocs for
     use on secondary connections to avoid repeated setup/teardowns.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899032 13f79535-47bb-0310-9956-ffa450edef68
2022-03-18 09:52:52 +00:00
df4d79d1a7 Sync CHANGES entries [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898697 13f79535-47bb-0310-9956-ffa450edef68
2022-03-07 14:54:52 +00:00
6418c66ab6 core: Make sure and check that LimitXMLRequestBody fits in system memory.
LimitXMLRequestBody can not exceed the size needed to ap_escape_html2() the
body without failing to allocate memory, so enforce this at load time based
on APR_SIZE_MAX, and make sure that ap_escape_html2() is within the bounds.

Document the limits for LimitXMLRequestBody in our docs.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898686 13f79535-47bb-0310-9956-ffa450edef68
2022-03-07 13:36:10 +00:00
0cb6384286 core: Simpler connection close logic if discarding the request body fails.
If ap_discard_request_body() sets AP_CONN_CLOSE by itself it simplifies and
allows to consolidate end_output_stream() and error_output_stream().



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898683 13f79535-47bb-0310-9956-ffa450edef68
2022-03-07 13:19:37 +00:00
815cf05bb2 mod_rewrite: URI-to-filename rewrites to transparently handle proxy mappings.
Since mod_rewrite works on r->filename and mod_proxy's mapping=servlet|decoded
sets its "proxy:" URL there at pre_translate_name stage (i.e. before
mod_rewrite's translate_name hook), users have to match the full proxy URL in
their RewriteRules to handle proxy mappings, which is not very friendly nor
consistent with how proxy non-mapping requests have to be matched.

Let's use r->filename = r->uri in hook_uri2file() for pre_trans'ed reverse
proxy requests, and restore r->filename to its original value if the request
was finally DECLINED (like in hook_fixup).

But if a proxy mapping gets rewritten to a non-proxy request, clear any
proxy specific r->proxyreq or r->handler so that processing continues
accordingly.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898509 13f79535-47bb-0310-9956-ffa450edef68
2022-03-01 13:26:03 +00:00
338daf4719 *) mod_watchdog: use the child_stopping and child_stopped hooks
to shutdown workers before pool destruction releases global
     resources and libraries.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898370 13f79535-47bb-0310-9956-ffa450edef68
2022-02-24 11:56:01 +00:00
2e239ed8e6 * core/mpm: add hook 'child_stopped` that gets called when the MPM has
stopped all processing in a child process. This is when all running
    threads shall be stopped and joined.
    [Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898369 13f79535-47bb-0310-9956-ffa450edef68
2022-02-24 11:53:53 +00:00
6137cd7b74 *) mod_http2: preserve the port number given in a HTTP/1.1
request that was Upgraded to HTTP/2. Fixes PR65881.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898146 13f79535-47bb-0310-9956-ffa450edef68
2022-02-17 10:06:31 +00:00
d27a32da69 * Change the logic to choose the maximum of both timeouts (front end socket,
backend socket) instead of the minimum as backend timeouts can be
  configured more selectively (per worker if needed) as front end timeouts
  and typically the backend timeouts reflect the application requirements
  better.

PR: 65886


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898127 13f79535-47bb-0310-9956-ffa450edef68
2022-02-16 12:35:36 +00:00
b90220157d *) mod_http2: :scheme pseudo-header values, not matching the
connection scheme, are forwarded via absolute uris to the
     http protocol processing to preserve semantics of the request.
     Checks on combinations of pseudo-headers values/absence
     have been added as described in RFC 7540.
     Fixes <https://github.com/icing/mod_h2/issues/230>.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897940 13f79535-47bb-0310-9956-ffa450edef68
2022-02-10 10:59:08 +00:00
600072cf7c ab: Fix the detection for when the server performed a legitimate
connection close as per RFC7230 6.3.1. We must check whedther the
connection was previously kept alive, and not whether the current
closed request is keepalive.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897912 13f79535-47bb-0310-9956-ffa450edef68
2022-02-09 18:23:23 +00:00
4a6bf7f895 *) mod_http2: when a h2 request carries a ':scheme' pseudoheader,
it gives a 400 response if the scheme does not match the
    connection. Fixes <https://github.com/icing/mod_h2/issues/230>.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897872 13f79535-47bb-0310-9956-ffa450edef68
2022-02-08 13:38:49 +00:00
5540d05c9f ab: Add an optional ramp delay when starting concurrent connections so
as to not trigger denial of service protection in the network. Report
levels of concurrency achieved in cases where the test completes before
full concurrency is achieved.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897866 13f79535-47bb-0310-9956-ffa450edef68
2022-02-08 12:34:52 +00:00
cbde30f832 * mod_md) do not interfere with requests to /.well-known/acme-challenge/
resources if challenge type 'http-01' is not configured for a domain.
    Fixes <https://github.com/icing/mod_md/issues/279>.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897863 13f79535-47bb-0310-9956-ffa450edef68
2022-02-08 12:18:45 +00:00
17f35eb66d Reinstate r1897458 accidentally reverted in r1897760.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897861 13f79535-47bb-0310-9956-ffa450edef68
2022-02-08 11:22:14 +00:00
fd79f533bf Follow up to r1896253: CHANGES entry. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897859 13f79535-47bb-0310-9956-ffa450edef68
2022-02-08 11:09:11 +00:00
7953689acc Sync CHANGES entries. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897858 13f79535-47bb-0310-9956-ffa450edef68
2022-02-08 11:04:49 +00:00
711bf3ee18 *) mod_md: the status description in MDomain's JSON, exposed in the
md-status handler (if configure) did sometimes not carry the correct
     message when certificates needed renew.
     [Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897819 13f79535-47bb-0310-9956-ffa450edef68
2022-02-07 14:40:46 +00:00
b11e669f07 *) core/mod_ssl/mpm_event: reverting changes to nonblocing SSL handshakes
to stabilize CI tests again. Previous revision of trunk has been copied
     to branches/trunk-ssl-handshake-unblocking to make those into a PR where
     changes can be discussed and tested separately.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897760 13f79535-47bb-0310-9956-ffa450edef68
2022-02-04 12:22:26 +00:00
c6960b3b4c * Stupid mine. Evgeny is a committer here
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897619 13f79535-47bb-0310-9956-ffa450edef68
2022-01-31 08:58:36 +00:00
df7e92eac8 * Fix typo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897615 13f79535-47bb-0310-9956-ffa450edef68
2022-01-31 08:19:14 +00:00
e5d6b2a50e * CHANGES entry for r1897182
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897614 13f79535-47bb-0310-9956-ffa450edef68
2022-01-31 08:16:35 +00:00
88ffb0ecd3 ab: Respond appropriately to SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE.
Previously the correct event was polled for, but the response to the poll
would call write instead of read, and read instead of write. PR 55952


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897458 13f79535-47bb-0310-9956-ffa450edef68
2022-01-25 15:54:22 +00:00
4145dfbd86 mod_reqtimeout: Set socket timeout for AP_MODE_INIT.
If the SSL handshake is initiated by ssl_hook_process_connection() in
AP_MODE_INIT mode, we still want to adapt the socket timeout according
to the time left for the handshake.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897422 13f79535-47bb-0310-9956-ffa450edef68
2022-01-24 16:08:14 +00:00
af55830264 mod_unixd: Make CoreDumpDirectory work for FreeBSD 11+. PR 65819.
FreeBSD 11+ coredumping requires tracing enabled via procctl(PROC_TRACE_CTL).

Submitted by: David CARLIER <devnexen gmail.com>
Reviewed by: ylavic (by inspection)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897269 13f79535-47bb-0310-9956-ffa450edef68
2022-01-20 20:03:04 +00:00
702712a43d Follow up to r1897240: CHANGES entry.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897242 13f79535-47bb-0310-9956-ffa450edef68
2022-01-20 11:37:16 +00:00
371f5669ca mpm_event: Fix a possible listener deadlock. PR 65769.
When the listener starts accepting more connections than the number of workers
already started (due to scheduling), the listening sockets gets disabled (per
AH03269) but nothing was re-enabling them before the end of the connections,
despite the creation of more idle/available workers in the meantime.
In the wost case there is no idle worker when the listener accepts the first
connection thus nothing to wake up the listener blocked in poll() with no
socket, hence a deadlock.

Fix this by waking up the listener when a worker becomes idle and this unblocks
connections_above_limit(). This is also worthwhile when all the workers are
started (fully initialized runtime) since the number of idle workers is a
condition for connections_above_limit() anyway so the sooner the listeners are
re-enabled the better (the other condition is the number of connections which
is unblocked appropriately by decrement_connection_count() already).

Also when a child exists with ps->quiescing == 1 and it's caught by
server_main_loop() before perform_idle_server_maintenance(), active_daemons was
not decrement as needed (including accross restarts), leading to an invalid
active_daemons accounting.

* server/mpm/event/event.c(should_enable_listensocks):
  New helper that returns whether listenning sockets can be poll()ed again.

* server/mpm/event/event.c(decrement_connection_count, listener_thread):
  Use should_enable_listensocks() where previously open-coded.

* server/mpm/event/event.c(worker_thread):
  Wake up the listener when is_idle => 1 and should_enable_listensocks().
  Have a single point of exit when workers_may_exit to make sure that the
  wake always occurs (even when exiting).

* server/mpm/event/event.c(server_main_loop):
  Decrement active_daemons not only when !ps->quiescing but also when
  ps->quiescing == 1, i.e. all the cases not handled by
  perform_idle_server_maintenance() already.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1896505 13f79535-47bb-0310-9956-ffa450edef68
2021-12-29 13:12:44 +00:00
f7067a9385 Add a change entry for r1896278
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1896279 13f79535-47bb-0310-9956-ffa450edef68
2021-12-22 14:36:29 +00:00
14ffd8c7b3 Sync changes-entries [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895953 13f79535-47bb-0310-9956-ffa450edef68
2021-12-14 15:24:32 +00:00
3ec0ffb9e1 http: Enforce that fully qualified uri-paths not to be forward-proxied
have an http(s) scheme, and that the ones to be forward proxied have a
      hostname, per HTTP specifications.

The early checks avoid failing the request later on and thus save cycles
for those invalid cases.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895921 13f79535-47bb-0310-9956-ffa450edef68
2021-12-13 18:55:18 +00:00
b8a58e6aa9 * Correctly sent a 100 Continue status code when sending an interim
response as result of an Expect: 100-Continue in the request and not the
  current status code of the request.

PR: 65725


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895719 13f79535-47bb-0310-9956-ffa450edef68
2021-12-09 08:38:30 +00:00
1598f7aebd *) mod_http2: fixed a bug in v2.0.0 that could lead to an infinite
loop when clients close connections prematurely.
     Enhanced the scoreboard status updates on h2 connections for
     mod_status. 'server-status' now gives a better idea what the
     connection is working on.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895614 13f79535-47bb-0310-9956-ffa450edef68
2021-12-06 10:34:27 +00:00
34da2e78b7 Sync CHANGES entries. [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895558 13f79535-47bb-0310-9956-ffa450edef68
2021-12-03 16:09:47 +00:00
85ae4b4d6a *) mod_tls: added mod_tls from abetterinternet, donated
by ISRG/Prossimo <https://github.com/abetterinternet/mod_tls>.
     - adds font-/backend TLS (v1.2/v1.3) via the Rust rustls crate
       and its rustls-ffi C binding <https://github.com/rustls/rustls-ffi>.
     - documentation at <https://github.com/abetterinternet/mod_tls>
       (adding to Apache's manual TBD)
     - build support for Apache httpd configure on *nix platforms,
       rustls is linked statically into mod_tls.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895432 13f79535-47bb-0310-9956-ffa450edef68
2021-11-30 16:29:20 +00:00
9974b5a0e6 * mod_http2: the new pollset implementation is disabled when
compiling with an APR version less than 1.6.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895349 13f79535-47bb-0310-9956-ffa450edef68
2021-11-26 09:29:07 +00:00
5338e45798 mod_proxy: SetEnv proxy-nohalfclose to disable half-close tunneling. PR 65662.
Some connect/wstunnel protocols might want half-close forwarding while some
might not, let's provide an r->subprocess_env opt-out.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895304 13f79535-47bb-0310-9956-ffa450edef68
2021-11-24 17:49:47 +00:00
331504f01e *) mod_md: values for External Account Binding (EAB) can
now also be configured to be read from a separate JSON
     file. This allows to keep server configuration permissions
     world readable without exposing secrets.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1895285 13f79535-47bb-0310-9956-ffa450edef68
2021-11-24 10:13:42 +00:00
81595a3948 * mod_http2: a regression in v1.15.24 of the modules was fixed that
could lead to httpd child processes not being terminated on a
    graceful reload or when reaching MaxConnectionsPerChild.
    When unprocessed h2 requests were queued at the time, these could stall.
    See <https://github.com/icing/mod_h2/issues/212>.
    [@hansborr, @famzah, Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894728 13f79535-47bb-0310-9956-ffa450edef68
2021-11-04 09:42:45 +00:00
51a214821c *) mod_md: adding v2.4.8 with the following changes
- Added support for ACME External Account Binding (EAB).
      Use the new directive `MDExternalAccountBinding` to provide the
      server with the value for key identifier and hmac as provided by
      your CA.
      While working on some servers, EAB handling is not uniform
      across CAs. First tests with a Sectigo Certificate Manager in
      demo mode are successful. But ZeroSSL, for example, seems to
      regard EAB values as a one-time-use-only thing, which makes them
      fail if you create a seconde account or retry the creation of the
      first account with the same EAB.
    - The directive 'MDCertificateAuthority' now checks if its parameter
      is a http/https url or one of a set of known names. Those are
      'LetsEncrypt', 'LetsEncrypt-Test', 'Buypass' and 'Buypass-Test'
      for now and they are not case-sensitive.
      The default of LetsEncrypt is unchanged.
    - `MDContactEmail` can now be specified inside a `<MDomain dnsname>`
      section.
    - Treating 401 HTTP status codes for orders like 403, since some ACME
      servers seem to prefer that for accessing oders from other accounts.
    - When retrieving certificate chains, try to read the repsonse even
      if the HTTP Content-Type is unrecognized.
    - Fixed a bug that reset the error counter of a certificate renewal
      and prevented the increasing delays in further attempts.
    - Fixed the renewal process giving up every time on an already existing
      order with some invalid domains. Now, if such are seen in a previous
      order, a new order is created for a clean start over again.
      See <https://github.com/icing/mod_md/issues/268>
    - Fixed a mixup in md-status handler when static certificate files
      and renewal was configured at the same time.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894610 13f79535-47bb-0310-9956-ffa450edef68
2021-10-29 09:04:38 +00:00
98595201df followup to r1894456: use a DirectorySlash argument instead
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894460 13f79535-47bb-0310-9956-ffa450edef68
2021-10-22 00:12:40 +00:00
b125eddc68 add DirectorySlashNotFound to silence scanners
Almost as awkwardly named as IndexForbiddenReturn404 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894456 13f79535-47bb-0310-9956-ffa450edef68
2021-10-21 18:54:46 +00:00
9c14928e79 add IndexForbiddenReturn404 to help silence scanners
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894455 13f79535-47bb-0310-9956-ffa450edef68
2021-10-21 18:52:48 +00:00
dcbf44fb14 mod_proxy_connect: Honor the smallest of the backend or client timeout.
It seems that mod_proxy_connect has never applied any timeout in its tunneling
loop. Address this by setting a default timeout in ap_proxy_tunnel_create()
since mod_proxy_connect does not overwrite tunnel->timeout (while proxy_http
and proxy_wstunnel do).

This default timeout is set to the smallest of the backend side or the client
side timeout.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894290 13f79535-47bb-0310-9956-ffa450edef68
2021-10-15 11:09:32 +00:00