Skip to content

ECH: rework config, add test cases - #23136

Closed
icing wants to merge 8 commits into
curl:masterfrom
icing:ech-config-rework
Closed

icing wants to merge 8 commits into
curl:masterfrom
icing:ech-config-rework

Conversation

@icing

@icing icing commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Move the easy configuration for tsl_ech into struct ssl_easy_config. Add ech, ech_config and ech_public to struct ssl_filter_config.

Use the ECH config values in connection matching, so that different settings for the same origin to not get mixed up.

Add test_23 for checking ECH with nghttpx if

  • nghttpx supports ECH
  • the openssl command is from OpenSSL 4 or later

Verifies all ECH modes good/bad configs and the public name with OpenSSL.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The quiche ECH path passes the wrong object to the HTTPS-RR helper, and the QUIC fallback contains invalid C syntax.

Review effort: Balanced
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Moves ECH settings into SSL connection configuration, prevents reuse across incompatible ECH settings, and adds nghttpx-based ECH tests.

Changes:

  • Centralizes ECH and HTTPS-RR handling across TLS/QUIC backends.
  • Adds ECH configuration cloning and connection matching.
  • Adds OpenSSL/nghttpx ECH test infrastructure and coverage.
File Description
tests/​http/​testenv/​nghttpx.py Adds ECH-enabled TCP and QUIC server support.
tests/​http/​testenv/​env.py Detects ECH tools and generates configurations.
tests/​http/​testenv/​__init__.py Exports the TCP nghttpx server.
tests/​http/​test_23_ech.py Tests ECH modes, configurations, and public names.
tests/​http/​Makefile.am Distributes the new test.
tests/​http/​conftest.py Adds the TCP nghttpx fixture.
src/​config2setopts.c Applies ECH options in dependency order.
lib/​vtls/​wolfssl.h Removes the backend-specific HTTPS-RR helper.
lib/​vtls/​wolfssl.c Uses connection-scoped ECH configuration.
lib/​vtls/​vtls.h Declares shared ECH helpers.
lib/​vtls/​vtls.c Implements shared ECH decisions.
lib/​vtls/​vtls_config.h Adds ECH connection/easy fields.
lib/​vtls/​vtls_config.c Clones, matches, and cleans ECH configuration.
lib/​vtls/​rustls.c Migrates rustls to connection-scoped ECH settings.
lib/​vtls/​openssl.h Removes the OpenSSL-specific HTTPS-RR helper.
lib/​vtls/​openssl.c Migrates OpenSSL ECH handling and tracing.
lib/​vquic/​vquic.c Uses the inserted QUIC filter for ECH resolution.
lib/​vquic/​cf-quiche.h Extends the insertion interface.
lib/​vquic/​cf-quiche.c Returns the inserted quiche filter.
lib/​vquic/​cf-ngtcp2.h Extends the ngtcp2 insertion interface.
lib/​vquic/​cf-ngtcp2.c Returns the inserted ngtcp2 filter.
lib/​vquic/​cf-ngtcp2-cmn.c Uses the shared HTTPS-RR helper.
lib/​urldata.h Removes the former ECH setting field.
lib/​setopt.c Stores ECH mode in SSL easy configuration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/vquic/cf-quiche.c Resolved
Comment thread tests/http/testenv/env.py Resolved
Comment thread lib/vtls/vtls_config.c Resolved
icing added 6 commits October 5, 2026 09:55
Move the easy configuration for `tsl_ech` into `struct ssl_easy_config`.
Add `ech`, `ech_config` and `ech_public` to `struct ssl_filter_config`.

Use the ECH config values in connection matching, so that different
settings for the same origin to not get mixed up.

Add test_23 for checking ECH with nghttpx if
- nghttpx supports ECH
- the `openssl` command is from OpenSSL 4 or later

Verifies all ECH modes good/bad configs and the public name
with OpenSSL.
- env.py: set ECH public name to have prefix 'public.'
- test_23: fix expectations
- fix quiche macro use to pass cf
- restrict some tests to openssl (and not lookalikes) that need it
- add test for config matching on different ECH inputs
@icing
icing force-pushed the ech-config-rework branch from afe42d4 to 704bec4 Compare October 5, 2026 07:55
icing added 2 commits October 5, 2026 10:02
- duplicate definitions after rebase
- f string
- unused var
@bagder

bagder commented Oct 7, 2026

Copy link
Copy Markdown
Member

@icing: merge now or post 8.23.0 ?

@icing

icing commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

I'd vote for now as ECH through HTTPS proxies does not work otherwise.

@bagder bagder closed this in 15ad1b8 Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants