tests: support multiple HTTPS RRs for ECH configs #504
+130
−44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Similar to a change in the upstream Rustls ech-client.rs demo we want to be able to process multiple HTTPS records for a given domain, and look at each ECH config list from each record for a potential compatible config. Follow-up to #485.
Mechanically this means:
Updating the
test/ech_fetch.rs
helper to support writing multiple.bin
files when there are multiple HTTPS records w/ ECH configs. The tool now outputs to stdout a comma separated list of the files it writes to make it easier to use with theclient.c
example.Updating the
tests/client.c
example to treat theRUSTLS_ECH_CONFIG_LIST
env var as a comma separated list of ECH config lists. We now loop through each and only fail if all of the provided files are unable to be used to configure the client config with a compatible ECH config.Doing string manipulation with C remains "a delight". For Windows compat we achieve tokenizing the string by the comma delim with a define to call either
strtok_r
with GCC/clang, orstrtok_s
with MSCV.You can test this update with:
If you're unlucky and the first HTTPS record served is the one with invalid configs you should see output like the following showing the client skipping over the
.1
config list and using the.2
one instead:This logic will also need to be ported into #497. I'll do that shortly but expect we can land this PR first against the pre-existing
client.c
and then catch 497 up afterwards.Resolves #503