293 Commits

Author SHA1 Message Date
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
4f9e7cf5d7 mpm_event: Restart stopping of idle children after a load peak. PR 65626.
r1770752 added an heuristic to avoid stopping children when the load triggers
MaxSpareThreads but children take some time to shut down until the point where
active_daemons_limit/ServerLimit is reached (scoreboard full) and no child gets
created to handle incoming connections.

However when this happens there is nothing to stop children again when the load
settles down (besides MaxRequestsPerChild, which may be 0) so let's restart to
stop children again if/when idle_thread_count reaches max_workers / 4.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894285 13f79535-47bb-0310-9956-ffa450edef68
2021-10-15 10:29:00 +00:00
59b7c104ce *) core: Be safe with ap_lingering_close() called with a socket NULL-ed.
PR 65627. 

mod_itk seems to:
  ap_set_core_module_config(c->conn_config, NULL)
before calling ap_lingering_close(), causing a crash after r1891721.
Until we have an API to no-op ap_lingering_close(), let's be safe.

* server/connection.c(ap_start_lingering_close):
  The socket should not be NULL here, add an assertion.

* server/connection.c(ap_lingering_close):
  Set c->aborted if the socket is NULL, and give up.

Submitted by: acmondor <bz.apache.org acmondor.ca>, ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894171 13f79535-47bb-0310-9956-ffa450edef68
2021-10-12 16:48:18 +00:00
6a355db082 *) mod_http2:
- Fixed an issue since 1.15.24 that "Server" headers in proxied requests
       were overwritten instead of preserved. [PR by @daum3ns]
     - Added directove 'H2StreamTimeout' to configure a separate value for HTTP/2
       streams, overriding server's 'Timeout' configuration. [rpluem]
     - HTTP/2 connections now use pollsets to monitor the status of the
       ongoing streams and their main connection when host OS allows this.
     - Removed work-arounds for older versions of libnghttp2 and checking
       during configure that at least version 1.15.0 is present.
     - The HTTP/2 connection state handler, based on an experiment and draft
       at the IETF http working group (abandoned for some time), has been removed.
     - H2SerializeHeaders no longer has an effect. A warning is logged when it is
       set to "on". The switch enabled the internal writing of requests to be parsed
       by the internal HTTP/1.1 protocol handler and was introduced to avoid
       potential incompatibilities during the introduction of HTTP/2.
     - Removed the abort/redo of tasks when mood swings lower the active limit.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894163 13f79535-47bb-0310-9956-ffa450edef68
2021-10-12 13:34:01 +00:00
fa7f375306 mod_proxy_uwsgi: Remove duplicate slashes at the beginning of PATH_INFO.
To accommodate for configs like:
    ProxyPass /uwsgi-pp uwsgi://localhost:8001/
which before r1892805 did not produce a leading double-slash in PATH_INFO.

Submitted by: rpluem



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894074 13f79535-47bb-0310-9956-ffa450edef68
2021-10-09 15:22:00 +00:00
476b41695c Sync CHANGES [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893983 13f79535-47bb-0310-9956-ffa450edef68
2021-10-07 12:41:24 +00:00
607bc8677f Missing credits [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893979 13f79535-47bb-0310-9956-ffa450edef68
2021-10-07 12:29:31 +00:00
48b5dfd696 core: Add ap_unescape_url_ex() for better decoding control, and deprecate
unused AP_NORMALIZE_DROP_PARAMETERS flag.
 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893971 13f79535-47bb-0310-9956-ffa450edef68
2021-10-07 12:00:20 +00:00
7ecfc5b3a8 * Fix memory leak in case of failures to load the private key.
PR: 65620


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893969 13f79535-47bb-0310-9956-ffa450edef68
2021-10-07 11:55:51 +00:00
e150697086 core: AP_NORMALIZE_DECODE_UNRESERVED should normalize the second encoded dot.
Otherwise ap_normalize_path() can leave some "%2e" encoded.
 


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893724 13f79535-47bb-0310-9956-ffa450edef68
2021-09-29 12:35:25 +00:00
3d2842e915 mod_proxy: Add tunnel_forward hook.
* modules/proxy/mod_proxy.h, modules/proxy/mod_proxy.c:
  Declare/implement the hook.

* modules/proxy/proxy_util.c(proxy_transfer):
  Run tunnel_forward hooks when called by the tunneling loop.
  Simpler input/output brigade cleanup on exit.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893603 13f79535-47bb-0310-9956-ffa450edef68
2021-09-24 15:52:50 +00:00
df3a613555 * Update CHANGES [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893590 13f79535-47bb-0310-9956-ffa450edef68
2021-09-24 06:45:09 +00:00
7f08c2bfa1 * Correctly handle errors returned by dav providers on REPORT requests.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893589 13f79535-47bb-0310-9956-ffa450edef68
2021-09-24 06:42:04 +00:00
8720881b06 * Correctly decrement active_daemons also in the case that the child
process decides on its own to die because of MaxRequestsPerChild.

PR: 65592


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893520 13f79535-47bb-0310-9956-ffa450edef68
2021-09-22 18:48:25 +00:00
6d476a6695 mod_proxy: Handle UDS URIs with empty hostname as if they had no hostname.
It was reported to me (privately) that r1893101 broke existing settings like:
  SetHandler "proxy:unix:///path/to/uds.sock|fcgi://localhost/"

RFC 3986 (section 3.2.2) says that:
   If the URI scheme defines a default for host, then that default
   applies when the host subcomponent is undefined or when the
   registered name is empty (zero length).  For example, the "file" URI
   scheme is defined so that no authority, an empty host, and
   "localhost" all mean the end-user's machine, whereas the "http"
   scheme considers a missing authority or empty host invalid.

Let's consider that the "unix" scheme is closer to the "file" scheme than
the "http" one, and accept "unix:///path/to/uds.sock" as a valid URI.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893519 13f79535-47bb-0310-9956-ffa450edef68
2021-09-22 18:47:09 +00:00
6d76cbb910 mod_rewrite: Fix UDS ("unix:") scheme for [P] rules. PR 57691 + 65590.
Handle the unix: scheme as an obsolute URI or a rule like:
  RewriteRule ^/(.*) unix:/path/to/uds.sock|fcgi://localhost/$1 [P]
sets r->filename for /index.html as:
  proxy:http://www.example.com/unix:/path/to/uds.sock|http://localhost/index.html
instead of the expected:
  proxy:unix:/path/to/uds.sock|http://localhost/index.html

Submitted by: Janne Peltonen <janne.peltonen sange.fi>
Reviewed by: ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893516 13f79535-47bb-0310-9956-ffa450edef68
2021-09-22 18:16:38 +00:00
994787e126 * Add change entry for r1893497 [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893507 13f79535-47bb-0310-9956-ffa450edef68
2021-09-22 07:02:28 +00:00
00e2ca574f *) mod_md: when MDMessageCmd for a 'challenge-setup:<type>:<dnsname>'
fails (!= 0 exit), the renewal process is aborted and an error is
     reported for the MDomain. This provides scripts that distribute
     information in a cluster to abort early with bothering an ACME
     server to validate a dns name that will not work. The common
     retry logic will make another attempt in the future, as with
     other failures.
     Fixed a bug when adding private key specs to an already working
     MDomain, see <https://github.com/icing/mod_md/issues/260>.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893399 13f79535-47bb-0310-9956-ffa450edef68
2021-09-17 12:18:41 +00:00
44abd7180e *) mod_md: fixed a bug in handling multiple parallel OCSP requests. These could
run into an assertion which terminated (and restarted) the child process where
     the task was running. Eventually, all OCSP responses were collected, but not
     in the way that things are supposed to work.
     See also <https://bz.apache.org/bugzilla/show_bug.cgi?id=65567>.
     The bug was possibly triggered when more than one OCSP status needed updating
     at the same time. For example for several renewed certificates after a server
     reload.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893359 13f79535-47bb-0310-9956-ffa450edef68
2021-09-15 13:22:27 +00:00
2fd8dd4a5e formatting change entry [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893215 13f79535-47bb-0310-9956-ffa450edef68
2021-09-10 08:18:32 +00:00
5057dc6a8e * mod_http2: when a server is restarted gracefully, any idle h2 worker
threads are shut down immediately. [Stefan Eissing]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893214 13f79535-47bb-0310-9956-ffa450edef68
2021-09-10 08:14:48 +00:00
2b7f51ade7 core: Add ap_create_connection() to create a server or client/proxy connection.
c->outgoing shouldn't be set by mod_ssl, ap_create_connection() allows that
and this commit also replaces all the calls to ap_run_create_connection() in
mod_proxy modules (not in the MPMs which create incoming connections only).

* include/http_connection.h, server/connection.c:
  Declare and implement ap_create_connection().

* modules/proxy/proxy_util.c, modules/proxy/mod_proxy_connect.c,
  modules/proxy/mod_proxy_ftp.c:
  Use ap_create_connection() instead of ap_run_create_connection(), and don't
  provide a connection_id a scoreboard handle for outgoing connection.

* server/log.c(do_errorlog_default):
  Use c->outgoing instead of c->sbh to determine if it's a "client" or "remote"
  connection.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893184 13f79535-47bb-0310-9956-ffa450edef68
2021-09-09 16:55:24 +00:00
40df9da013 Sync CHANGES [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893049 13f79535-47bb-0310-9956-ffa450edef68
2021-09-07 15:29:23 +00:00
74c097f0e1 core: Initialize the request fields on read failure to avoid NULLs.
* server/protocol.c(read_request_line):
  Set r->method_number to M_INVALID and r->{method,uri,unparsed_uri} to "-"
  when read fails, ap_parse_request_line() will never be called.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893030 13f79535-47bb-0310-9956-ffa450edef68
2021-09-07 13:09:07 +00:00
e8dce10f62 Revert r1893026, will re-commit with minimal changes to ease backport.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893028 13f79535-47bb-0310-9956-ffa450edef68
2021-09-07 13:05:22 +00:00
d4f195853b core: Initialize the request fields on read failure to avoid NULLs.
* server/protocol.c(read_request_line):
  Set r->method_number to M_INVALID and r->{method,uri,unparsed_uri} to "-"
  when read fails, ap_parse_request_line() will never be called.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893026 13f79535-47bb-0310-9956-ffa450edef68
2021-09-07 13:00:06 +00:00
22895e737d mod_proxy: Don't canonicalize with both nocanon and ProxyPassInterpolateEnv On.
If nocanon is set, we should match the unparsed_uri against the interpolated
alias (not the ProxyPass'ed one) when verifying the resulting length. Otherwise
we falsely restore the canonicalized URL in case of mismatch.  PR 65549.

Submitted by: Joel Self <joelself gmail.com>



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893016 13f79535-47bb-0310-9956-ffa450edef68
2021-09-07 10:16:03 +00:00
03442ed466 mpm_event: Fix children processes possibly not stopped on graceful restart.
The number of children spawned can go above active_daemons_limit due to
exponential idle_spawn_rate growth (x 2), enforce the upper limit in
perform_idle_server_maintenance().  PR 63169.

Proposed by: Joel Self <joelself gmail.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893014 13f79535-47bb-0310-9956-ffa450edef68
2021-09-07 09:34:09 +00:00
0df673fcce Reduce the time window where duplicates may be generated by mod_uniqueid
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892915 13f79535-47bb-0310-9956-ffa450edef68
2021-09-05 05:58:57 +00:00
8fc481e28a Revert r1887244 and r1887245 which causes issues on Windows
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892914 13f79535-47bb-0310-9956-ffa450edef68
2021-09-05 05:41:37 +00:00
2a8cdcefdf Sync CHANGES [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892879 13f79535-47bb-0310-9956-ffa450edef68
2021-09-03 17:07:37 +00:00
520dcd80a4 mod_proxy: Faster unix socket path parsing in the "proxy:" URL.
The actual r->filename format is "[proxy:]unix:path|url" for UDS, no need to
strstr(,"unix:") since it's at the start of the string.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892814 13f79535-47bb-0310-9956-ffa450edef68
2021-09-02 12:37:02 +00:00
b364cad72b mod_proxy_uwsgi: Fix PATH_INFO setting for generic worker.
When the generic "proxy:reverse" worker is selected for an uwsgi scheme, the
worker name is irrelevant so uwscgi_handler() should point to the PATH_INFO
directly from the given URL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892805 13f79535-47bb-0310-9956-ffa450edef68
2021-09-02 09:53:43 +00:00
62e6e7081e mod_md:
* Certificate/keys pairs are verified as matching before a renewal is accepted
   as successful or a staged renewal is replacing the existing certificates.
   This avoid potential mess ups in the md store file system to render the active
   certificates non-working. [@mkauf]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892782 13f79535-47bb-0310-9956-ffa450edef68
2021-09-01 13:16:03 +00:00
e8228ba4e6 mod_proxy: Fix potential tunneling infinite loop and spurious timeout.
PRs 65521 and 65519.

* modules/proxy/proxy_util.c(ap_proxy_tunnel_run):
  Avoid an infinite loop by shutting down the connection for write when poll()
  returns POLLHUP and read is already down.  PR 65521.

* modules/proxy/proxy_util.c(ap_proxy_tunnel_run):
  When write completion is finished don't check for ap_filter_input_pending()
  before proxy_tunnel_forward() to flush input data, this is a nonblocking read
  already which will do the same thing implicitely. ap_filter_input_pending()
  is broken in 2.4.x without the whole pending data mechanism (not backported
  yet), so let's align here.  PR 65519.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892740 13f79535-47bb-0310-9956-ffa450edef68
2021-08-30 18:04:20 +00:00
c1619c6843 Sync CHANGES entries [skip ci].
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1892737 13f79535-47bb-0310-9956-ffa450edef68
2021-08-30 17:05:13 +00:00
19360d53df * core/mpm: add hook 'child_stopping` that gets called when the MPM is
stopping a child process. The additional `graceful` parameter allows
    registered hooks to free resources early during a graceful shutdown.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891919 13f79535-47bb-0310-9956-ffa450edef68
2021-07-31 13:36:19 +00:00
67c17882e1 Follow up to r1891716: CHANGES entry. [skip ci]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891728 13f79535-47bb-0310-9956-ffa450edef68
2021-07-22 17:18:00 +00:00
3fe911d3c9 *) mod_md:
- Domain names in `<MDomain ...>` can now appear in quoted form.
     - Fixed a failure in ACME challenge selection that aborted further searches
       when the tls-alpn-01 method did not seem to be suitable.
     - Changed the tls-alpn-01 setup to only become unsuitable when none of the
       dns names showed support for a configured 'Protocols ... acme-tls/1'. This
       allows use of tls-alpn-01 for dns names that are not mapped to a VirtualHost.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891683 13f79535-47bb-0310-9956-ffa450edef68
2021-07-20 12:44:31 +00:00
2aa1c1415a * mod_http2:
- Added a timeout to h2 worker cleanup to exit latest after 5 seconds of
     waiting on idle workers to terminate. This happens after all connections
     have been processed. a WARNING is logged in case workers lagged behind.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891566 13f79535-47bb-0310-9956-ffa450edef68
2021-07-15 08:29:19 +00:00
ff0f512db1 mod_proxy: Fix icomplete initialization of BalancerMember(s) from the manager.
Clear the workers created in ap_proxy_sync_balancer(), notably ->local_status
for below ap_proxy_initialize_worker() to initialize all the child structures
like ->cp and ->cp->reslist, avoiding a possible crash when the workers are
used at runtime.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891477 13f79535-47bb-0310-9956-ffa450edef68
2021-07-12 10:32:21 +00:00
c07608101f *) mod_md: fixed a potential null pointer dereference if ACME/OCSP
server returned 2xx responses without content type. Reported by chuangwen.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891470 13f79535-47bb-0310-9956-ffa450edef68
2021-07-12 07:52:28 +00:00
2d34278612 *) mod_http2:
- Aborting requests via RST_STREAM no longer affect the available
     resources of a connection when the first chunk of the response
     body has been sent.
   - H2Min/MaxWorkers behave as intended again. The module will initially
     create H2MinWorkers threads and add up to H2MaxWorkers when needed. These
     additional workers time out when idle after H2MaxWorkerIdleSeconds and
     disappear again.
   - When the shutdown of a child is detected (e.g. graceful shutdown), the
     module will terminate all idle workers above H2MinWorkers right away.
     This detection currently only happens when a HTTP/2 connection is active.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891312 13f79535-47bb-0310-9956-ffa450edef68
2021-07-06 13:06:00 +00:00
71736a1f42 Sync CHANGES entries.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891217 13f79535-47bb-0310-9956-ffa450edef68
2021-07-02 22:39:11 +00:00
542efc0f00 mpm_proxy: Fix possible reuse/merging of Proxy(Pass)Match workers. PR 65419.
We can't truncate ProxyMatch's worker name/url to the first '$' substitution
without possibly colliding with other workers. This also makes the matching
done at runtime by ap_proxy_strcmp_ematch() completely pointless.

To fix this and still address r1878467 (i.e. make http://host:port$1 a "valid"
URL), we need to remove '$' substitutions from the :port part of the URL only
since it's allowed anywhere else by apr_uri_parse().

So let's strip them before apr_uri_parse() and prepend them back in the path
before apr_uri_unparse() to restore the original URL. Non-matchable workers are
not concerned so ap_proxy_define_worker() is made a local helper (w/o the ap_
prefix) which takes "matchable" as argument and can then be called by both
ap_proxy_define_[match_]worker() functions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891206 13f79535-47bb-0310-9956-ffa450edef68
2021-07-02 14:58:46 +00:00
06a3e22e28 *) mod_ssl: tighten the handling of ALPN for outgoing (proxy)
connections. If ALPN protocols are provided and sent to the
     remote server, the received protocol selected is inspected
     and checked for a match. Without match, the peer handshake
     fails.
     An exception is the proposal of "http/1.1" where it is
     accepted if the remote server did not answer ALPN with
     a selected protocol. This accomodates for hosts that do
     not observe/support ALPN and speak http/1.x be default.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1890693 13f79535-47bb-0310-9956-ffa450edef68
2021-06-11 10:45:25 +00:00
a4f45f275b *) core/mod_proxy/mod_ssl:
Adding `outgoing` flag to conn_rec, indicating a connection is
     initiated by the server to somewhere, in contrast to incoming
     connections from clients.
     Adding 'ap_ssl_bind_outgoing()` function that marks a connection
     as outgoing and is used by mod_proxy instead of the previous
     optional function `ssl_engine_set`. This enables other SSL
     module to secure proxy connections.
     The optional functions `ssl_engine_set`, `ssl_engine_disable` and
     `ssl_proxy_enable` are now provided by the core to have backward
     compatibility with non-httpd modules that might use them. mod_ssl
     itself no longer registers these functions, but keeps them in its
     header for backward compatibility.
     The core provided optional function wrap any registered function
     like it was done for `ssl_is_ssl`.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1890605 13f79535-47bb-0310-9956-ffa450edef68
2021-06-08 14:37:44 +00:00