1
0
mirror of https://github.com/apache/httpd.git synced 2025-09-18 07:47:41 +03:00

12054 Commits

Author SHA1 Message Date
Joe Orton
0c9cd095ce mod_ssl: Add support for Encrypted Client Hello (ECH) based off
proposed OpenSSL 4.0 API. Notes from PR #551:

This build only supports ECH "shared-mode" where mod_ssl does the ECH
decryption and also hosts both the ECH `public-name` and `backend` web
sites.

## Build

> [!NOTE]
> ECH is not yet a part of an OpenSSL release, our current goal is that ECH be
> part of an OpenSSL 4.0 release in spring 2026. 

There is client and server ECH code in the OpenSSL ECH feature branch at
[https://github.com/openssl/openssl/tree/feature/ech](https://github.com/openssl/openssl/tree/feature/ech).
At present, ECH-enabling apache2 therefore requires building from source, using
the OpenSSL ECH feature branch.

## Code changes

- All code changes are within `modules/ssl` and are protected via `#ifdef
  HAVE_OPENSSL_ECH`.  That's defined in `ssl_private.h` if the included
`ssl.h` defines `SSL_OP_ECH_GREASE`.

- There're a bunch of changes to add the new `SSLECHKeyDir` directive that
  are mosly obvious.

- We load the keys from `SSLECHKeyDir` using the `load_echkeys()` function in
  `ssl_engine_init.c`. That also ECH-enables the `SSL_CTX` when keys are
  loaded, which triggers ECH decryption as needed.

> [!NOTE]
> `load_echkeys()` will include the public component all loaded keys in the ECH
> `retry-configs` in the fallback scenario. If desired, we could add a naming
> convention or additional configuration setting to distinguish which to
> include in `retry-configs` or not. For now, we assume that'd better be done
> in a subsequent PR, if experience shows the feature is really useful/needed.
> (We can envisage some odd deployments where that might be the case, but not
> clear those'd really happen - it'd seem to need loads of key pairs or else
> some that are never published in the DNS that we don't want to expose to
> random clients - neither seems compelling.)

- We add a callback to `SSL_CTX_ech_set_callback` also in `ssl_engine_init.c`.

- We add calls to set the `SSL_ECH_STATUS` etc. variables to the environment
(for PHP etc) in `ssl_engine_kernel.c` and also do the logging of ECH outcomes
(to the error log).

Submitted by: sftcd <stephen.farrell cs.tcd.ie>, rpluem
Github: closes #551


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1928357 13f79535-47bb-0310-9956-ffa450edef68
2025-09-12 08:05:11 +00:00
Joe Orton
9cd6c92c95 mod_systemd: add missing space
Submitted by: Christian Hesse <mail eworm.de>
Github: closes #557


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1928356 13f79535-47bb-0310-9956-ffa450edef68
2025-09-12 07:35:31 +00:00
Ruediger Pluem
f04d0660b8 * Revert r1928222 as we cannot handle transfer encoding chunked
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1928225 13f79535-47bb-0310-9956-ffa450edef68
2025-09-04 08:08:00 +00:00
Ruediger Pluem
5cec2b41bd Perform OCSP requests via HTTP/1.1 instead of HTTP/1.0
According to https://docs.digicert.com/en/whats-new/change-log/certcentral-change-log.html#digicert-ending-support-for-http-1-0-connections-for-ocsp-and-crl-certificate-status-verification-checks-619426
Digicert stops supporting HTTP/1.0 for their OCSP responder, but still supports
HTTP/1.1. Hence switch to HTTP/1.1 to keep things working.
It is assumed that other OCSP responders support HTTP/1.1 as well.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1928222 13f79535-47bb-0310-9956-ffa450edef68
2025-09-04 06:06:15 +00:00
Ruediger Pluem
b917376bdb * include/httpd.h: Define HTTP_EARLY_HINTS (103) per RFC 8297.
* modules/http/http_protocol.c (status_lines): Add 103 response.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927935 13f79535-47bb-0310-9956-ffa450edef68
2025-08-21 07:04:46 +00:00
Ruediger Pluem
b832730060 Remove condition which is always false
If sslconn->non_ssl_request is set to either NON_SSL_SEND_REQLINE or
NON_SSL_SEND_HDR_SEP we cannot close the connection here.
We handle NON_SSL_SEND_REQLINE and NON_SSL_SEND_HDR_SEP
later again in the input filter and in ssl_hook_ReadReq
to return an appropriate error message to the client.

PR: 69773



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927880 13f79535-47bb-0310-9956-ffa450edef68
2025-08-19 12:12:41 +00:00
Stefan Eissing
1ff81212d0 *) mod_md: update to version 2.6.2
- Fix error retry delay calculation to not already doubling the wait
       on the first error.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927874 13f79535-47bb-0310-9956-ffa450edef68
2025-08-19 09:36:21 +00:00
Stefan Eissing
7019a88e61 *) mod_md: update to version 2.6.1
- Increasing default `MDRetryDelay` to 30 seconds to generate less bursty
       traffic on errored renewals for the ACME CA. This leads to error retries
        of 30s, 1 minute, 2, 4, etc. up to daily attempts.
     - Checking that configuring `MDRetryDelay` will result in a positive
       duration. A delay of 0 is not accepted.
     - Fix a bug in checking Content-Type of responses from the ACME server.
     - Added ACME ARI support (rfc9773) to the module. Enabled by default. New
       directive "MDRenewViaARI on|off" for controlling this.
     - Removing tailscale support. It has not been working for a long time
       as the company decided to change their APIs. Away with the dead code,
       documentation and tests.
     - Fixed a compilation issue with pre-industrial versions of libcurl.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927807 13f79535-47bb-0310-9956-ffa450edef68
2025-08-15 11:23:29 +00:00
Joe Orton
5c9c78d785 * modules/arch/unix/mod_unixd.ci (ap_unixd_setup_child):
Do not test euid=0 before going chroot

Nowaday chroot need CAP_SYS_CHROOT capability in its user namespace, and could
work without root.

Will allow to use chroot with lesser permission.

Submitted by: Bastien Roucariès <rouca debian.org>
PR: 69767
Github: closes #549


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927804 13f79535-47bb-0310-9956-ffa450edef68
2025-08-15 07:38:26 +00:00
Stefan Eissing
149f6c72d3 *) mod_http2: update to version 2.0.35
New directive `H2MaxStreamErrors` to control how much bad behaviour
     by clients is tolerated before the connection is closed.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927792 13f79535-47bb-0310-9956-ffa450edef68
2025-08-14 07:53:10 +00:00
Stefan Eissing
bddcfb1233 * mod_proxy_http2: add support for ProxyErrorOverride directive. PR69771
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927647 13f79535-47bb-0310-9956-ffa450edef68
2025-08-06 14:03:00 +00:00
Joe Orton
f40ebca143 * modules/http2/h2_proxy_session.c (open_stream),
modules/proxy/proxy_util.c (ap_proxy_create_hdrbrgd): Tweak wording
  only for preserve-host-but-no-Host-header warning log message, no
  functional change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927629 13f79535-47bb-0310-9956-ffa450edef68
2025-08-06 07:11:19 +00:00
Eric Covener
beb75b5cb5 future-proof by flattening expr rc to 0/1
Submitted By: ylavic



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927314 13f79535-47bb-0310-9956-ffa450edef68
2025-07-18 15:25:33 +00:00
Eric Covener
6e59b12422 rc already is set by result of expression eval
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927270 13f79535-47bb-0310-9956-ffa450edef68
2025-07-16 17:33:21 +00:00
Stefan Eissing
8e529cecca * mod_http2/mod_proxy_http2: fix a bug in calculating the log2 value of
integers, used in push diaries and proxy window size calculations.
    PR69741 [Benjamin P. Kallus]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927235 13f79535-47bb-0310-9956-ffa450edef68
2025-07-15 06:35:04 +00:00
Eric Covener
423c67c0c1 avoid compile error with curl < 7.44.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927054 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 15:29:13 +00:00
Eric Covener
a6b8db04ec improve h2 header error handling
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927038 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 11:56:48 +00:00
Eric Covener
63f48bb6f3 remove antiquated 'SSLEngine optional' TLS upgrade
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927037 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 11:55:00 +00:00
Eric Covener
349248060f tolerate missing host header in h2 proxy
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927036 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 11:53:43 +00:00
Eric Covener
d76573e760 update SNI validation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927035 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 11:51:57 +00:00
Eric Covener
5c8e7ca468 escape ssl vars
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927034 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 11:50:41 +00:00
Eric Covener
dd98030cb3 expand UNC checking
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927033 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 11:49:48 +00:00
Eric Covener
32cf503799 header only
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1927032 13f79535-47bb-0310-9956-ffa450edef68
2025-07-07 11:48:06 +00:00
Joe Orton
36f619966b mod_so: Add -D DUMP_MODULE_DATA to print module data in structured
format (TOML) including MMN information.

* modules/core/mod_so.c (print_mod_data): New function.
  (dump_loaded_modules): Use it if DUMP_MODULE_DATA is defined.

* docs/manual/programs/httpd.xml: Move -DDUMP_* docs to a new
  section, cover the above new option.

Github: closes #537


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1926737 13f79535-47bb-0310-9956-ffa450edef68
2025-06-26 09:21:25 +00:00
Joe Orton
9b06444951 * modules/ssl/ssl_private.h: Fix logic in r1926720 HAVE_OPENSSL_KEYLOG macro,
thanks to rpluem.

Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1926722 13f79535-47bb-0310-9956-ffa450edef68
2025-06-25 15:16:22 +00:00
Joe Orton
c2ffd2a551 * modules/ssl/ssl_private.h: For OpenSSL >= 3.5.0 drop $SSLKEYLOGFILE
handling inside mod_ssl where OpenSSL is built to handle that
  internally in libssl.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1926720 13f79535-47bb-0310-9956-ffa450edef68
2025-06-25 12:53:18 +00:00
Joe Orton
e5a19d43e0 mod_ssl: Accept expired client certs with optional_no_ca mode.
* modules/ssl/ssl_private.h (ssl_verify_error_is_optional): Add
  X509_V_ERR_CERT_HAS_EXPIRED to the list of error exceptions
  permitted for "optional_no_ca" mode.

Submitted by: Naveen Albert <apache2 phreaknet.org>
PR: 60028
Github: closes #509


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1926714 13f79535-47bb-0310-9956-ffa450edef68
2025-06-25 07:55:26 +00:00
Christophe Jaillet
9a2eca1ca1 Follow-up to r1922931.
In set_cookie_name() and set_cookie_name2(), now that the empty 'name' argument is explicitly handled, the error message in check_string() can be simplified because the cookie name can't be empty anymore when this function is called.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1926188 13f79535-47bb-0310-9956-ffa450edef68
2025-06-06 20:12:16 +00:00
Joe Orton
39265983d1 * modules/dav/fs/repos.c (dav_fs_remove_resource):
Return a 404 if apr_file_remove() fails with an ENOENT error,
  likely due to a race with another DELETE.

PR: 60746
Github: closes #535


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1926172 13f79535-47bb-0310-9956-ffa450edef68
2025-06-06 10:36:00 +00:00
Stefan Eissing
2de0d11e9b *) mod_md: update to version 2.5.2
- Fixed TLS-ALPN-01 challenges when multiple `MDPrivateKeys` are specified
       with EC keys before RSA ones. Fixes #377. [Stefan Eissing]
     - Fixed missing newlines in the status page output. [Andreas Groth]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1925979 13f79535-47bb-0310-9956-ffa450edef68
2025-05-30 12:45:59 +00:00
Stefan Eissing
b84e2e2068 *) mod_http2: update to version 2.0.32
The code setting the connection window size was set wrong,
     preventing `H2WindowSize` to work.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1925975 13f79535-47bb-0310-9956-ffa450edef68
2025-05-30 12:20:22 +00:00
Yann Ylavic
c15471ee3b mod_proxy: restore reuse of ProxyRemote connections when possible.
Fixes a regression from 2.4.59 (r1913907).

For a reverse proxy setup with a worker (enablereuse=on) and a
forward/CONNECT ProxyRemote to reach it, an open connection/tunnel
to/through the remote proxy for the same origin server (and using the
same proxy auth) should be reusable. Avoid closing them like r1913534
did.

* modules/proxy/proxy_util.c:
  Rename the struct to remote_connect_info since it's only used for
  connecting through remote CONNECT proxies. Axe the use_http_connect
  field, always true.

* modules/proxy/proxy_util.c(ap_proxy_connection_reusable):
  Remote CONNECT (forward) proxy connections can be reused if the auth
  and origin server infos are the same, so conn->forward != NULL is not
  a condition to prevent reusability.

* modules/proxy/proxy_util.c(ap_proxy_determine_connection):
  Fix the checks around conn->forward reuse and connection cleanup if
  that's not possible.

Submitted by: jfclere, ylavic
GH: closes #531


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1925743 13f79535-47bb-0310-9956-ffa450edef68
2025-05-22 14:38:41 +00:00
Joe Orton
bf19cfe634 * modules/dav/fs/repos.c (dav_fs_method_precondition):
Fix crashes when mod_dav_fs is not configured.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1925371 13f79535-47bb-0310-9956-ffa450edef68
2025-05-02 15:47:09 +00:00
Ruediger Pluem
e36237899d * Temporarily add back the query string to the URL as it might contain the
routing information for sticky sessions.

PR: 69443


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1925109 13f79535-47bb-0310-9956-ffa450edef68
2025-04-16 11:29:25 +00:00
Joe Orton
e6cfbfa30d mod_ssl: Check the SSLProtocol directive when loading the configuration
Previously, the SSLProtocol directive was checked at runtime. Apache quit if
the directive contained an invalid combination of protocols, and logged the
message "AH02231: No SSL protocols available [hint: SSLProtocol]".

With this change, most invalid SSLProtocol directives are detected when
checking the configuration, e.g. with \"httpd -t -f httpd.conf\".

Examples of invalid protocol combinations that are caught:
* SSLProtocol "-TLSv1"
* SSLProtocol "-all"
* SSLProtocol "TLSv1.2 -TLSv1.2"

Submitted by: Michael Kaufmann <mail michael-kaufmann.ch>
Github: closes #523


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924955 13f79535-47bb-0310-9956-ffa450edef68
2025-04-09 08:01:24 +00:00
Joe Orton
b3a52bec98 mod_asis: Fix the log level of the message AH01236
Change the log level from ERROR to DEBUG.

The message \"mod_asis: ap_pass_brigade failed for file ...\" was logged with
the level ERROR. This log level is inappropriate here, because a client can
trigger this log message by aborting the request.

Most other modules don't log at all or use the log level DEBUG when
ap_pass_brigade() fails.

Submitted by: Michael Kaufmann <mail michael-kaufmann.ch>
Github: closes #527


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924954 13f79535-47bb-0310-9956-ffa450edef68
2025-04-09 07:43:49 +00:00
Graham Leggett
5a148b5b9d mod_ssl: Remove warning over potential uninitialised value
for ssl protocol prior to protocol selection.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924757 13f79535-47bb-0310-9956-ffa450edef68
2025-04-03 14:36:16 +00:00
Stefan Eissing
303ca68847 * mod_proxy_http2: revert r1912193 for detecting broken backend connections
as this interferes with backend selection who a node is unresponsive.
    PR69624.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924554 13f79535-47bb-0310-9956-ffa450edef68
2025-03-24 12:48:09 +00:00
Joe Orton
ffeacdcc52 Fix typo in code comments; dependancies -> dependencies
Submitted by: John Bampton <jbampton gmail.com>
Github: closes #520


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924446 13f79535-47bb-0310-9956-ffa450edef68
2025-03-18 09:54:15 +00:00
Stefan Eissing
f3448d02da *) mod_http2: Fix handling of 304 responses from mod_cache. PR 69580.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924267 13f79535-47bb-0310-9956-ffa450edef68
2025-03-10 10:09:43 +00:00
Stefan Eissing
fecd8da88a assign log tag
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924197 13f79535-47bb-0310-9956-ffa450edef68
2025-03-06 08:35:52 +00:00
Stefan Eissing
e1fe1d8505 *) mod_md: update to version 2.0.30
- Fixed bug in handling over long response headers. When the 64 KB limit
       of nghttp2 was exceeded, the request was not reset and the client was
       left hanging, waiting for it. Now the stream is reset.
     - Added new directive `H2MaxHeaderBlockLen` to set the limit on response
       header sizes.
     - Fixed handling of Timeout vs. KeepAliveTimeout when first request on a
       connection was reset.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924145 13f79535-47bb-0310-9956-ffa450edef68
2025-03-03 12:32:31 +00:00
Joe Orton
826f90e639 mod_lua: Fix memory handling in output filters.
* modules/lua/mod_lua.c (lua_output_filter_handle): Fix brigade
  iteration to use constant memory.

Submitted by: G.Grandes <guillermo.grandes gmail.com>
PR: 69590
Github: closes #517


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1924095 13f79535-47bb-0310-9956-ffa450edef68
2025-02-28 08:24:10 +00:00
Joe Orton
1e298ddfca mod_dav: Fix error handling for dav_fs_dir_file_name():
dav_fs_dir_file_name() will not set *fname_p to NULL on failure,
and all callers of dav_fs_dir_file_name() does not check the
return value of dav_fs_dir_file_name(), which could lead to an
undefined behavior against fname_p.

Fix this by adding return value check of dav_fs_dir_file_name()

Submitted by: Zhou Qingyang <zhou1615 umn.edu>
Github: closes #309


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1923813 13f79535-47bb-0310-9956-ffa450edef68
2025-02-14 16:08:23 +00:00
Stefan Eissing
e3d014c009 *) scoreboard/mod_http2: record durations of HTTP/2 requests.
PR 69579 [Pierre Brochard <pierre.brochard.1982@m4x.org>]



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1923754 13f79535-47bb-0310-9956-ffa450edef68
2025-02-12 09:43:40 +00:00
Ruediger Pluem
3af0d142f1 * Allow to unset cookies via negative lifetime values
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1923725 13f79535-47bb-0310-9956-ffa450edef68
2025-02-11 10:29:03 +00:00
Joe Orton
1db5c2359a Add API exposing the DavBasePath setting for use by DAV repository
backend modules (mod_dav_svn needs this for POST method handling).

* modules/dav/main/mod_dav.c (dav_get_base_path): New function.

* include/ap_mmn.h: Bump MMN minor.

Github: closes #513


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1923639 13f79535-47bb-0310-9956-ffa450edef68
2025-02-07 11:09:25 +00:00
Stefan Eissing
e07b7a2abd *) mod_md: update to v2.5.1
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1923592 13f79535-47bb-0310-9956-ffa450edef68
2025-02-05 12:30:07 +00:00
Stefan Eissing
49c2ee218f *) mod_http2: make test_h2_200_17+18 work reliably with
older and newer curl versions. Only a change in logging,
    no function module change.
    Newer curl send a GOAWAY on connection shutdown which
    triggers another code path that the test did not expect.
    Thanks to Rainer Jung for tracking this down.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1923187 13f79535-47bb-0310-9956-ffa450edef68
2025-01-17 16:12:28 +00:00
Stefan Eissing
202d0068d8 *) mod_md: update to version 2.4.31
- Improved error reporting when waiting for ACME server to verify domains
       or finalizing the order fails, e.g. times out.
     - Increasing the timeouts to wait for ACME server to verify domain names
       and issue the certificate from 30 seconds to 5 minutes.
     - Change a log level from error to debug when Stapling is enabled but a
       certificate carries no OCSP responder URL.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1923148 13f79535-47bb-0310-9956-ffa450edef68
2025-01-15 12:48:52 +00:00