Skip to content

[2.4.x] mod_http2: Send HTTP/2 error codes in GOAWAY frames - #1156

Merged
arturobernalg merged 1 commit into
apache:2.4.xfrom
erilor:2.4.x-goaway-error-codes
Dec 4, 2026
Merged

arturobernalg merged 1 commit into
apache:2.4.xfrom
erilor:2.4.x-goaway-error-codes

Conversation

@erilor

@erilor erilor commented Dec 3, 2026

Copy link
Copy Markdown

Backport of trunk r1939156 (#799), fixing PR 70212.

On 2.4.x, h2_session_shutdown() still sends its internal APR/nghttp2
status as the GOAWAY error code: an idle timeout goes out as 70007
(APR_TIMEUP) and an inadequate TLS connection as 22 (APR_EINVAL).
Clients and proxies that act on the error code treat a normal timeout
as a protocol error.

The trunk change applies cleanly to 2.4.x apart from
test_108_goaway.py, where this test_108_goaway.py:
marks r1939156 as backported_in="2.4.72", so older 2.4.x releases keep the expected failure.

@arturobernalg would you be able to take a look, since you authored the trunk change?


  • This PR does not report or address a security vulnerability
    (see SECURITY.md and
    https://www.apache.org/security/#reporting-a-vulnerability).
  • Code follows the httpd style guide.
  • New log messages (level debug or higher) use an empty APLOGNO() tag;
    numbers are assigned by a committer at merge time (see docs/log-message-tags/README).
  • If the change is user-visible, a changes-entries/*.txt file is included,
    following the template in README.CHANGES (not needed otherwise).
  • Test cases based on pyhttpd are included where appropriate, in the
    test/modules/xxx directory matching the modules/xxx module source,
    or test/modules/core for core server changes. On Unix, verify these
    pass locally with e.g. make check-pytest PYTEST_DIRS=test/modules/xxx.

Merge r1939156 from trunk (GitHub PR apache#799, PR 70212).

h2_session_shutdown() passed its reason, an APR or nghttp2 status, as the
error code of the GOAWAY frame. A connection timeout was sent as 70007
(APR_TIMEUP), an inadequate TLS connection as 22 (APR_EINVAL).

Give h2_session_shutdown() the HTTP/2 error code as a separate argument.
Timeouts and graceful shutdowns send NO_ERROR, failures INTERNAL_ERROR
and inadequate TLS parameters INADEQUATE_SECURITY.

test_108_goaway.py: mark r1939156 as backported_in 2.4.72, so releases
before 2.4.72 keep the expected failure.

@arturobernalg arturobernalg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@erilor Thanks for the backport. I'll leave it open 24h in case another committer wants to weigh in, then merge

@arturobernalg
arturobernalg merged commit 6fe5ac6 into apache:2.4.x Dec 4, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants