Add unit tests that TLS resumption fails due to ALPN mismatch#10633
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds regression unit tests to ensure TLS session resumption is rejected (falls back to a full handshake) when the negotiated ALPN differs from the ALPN bound to the original session/ticket, covering both TLS 1.2 session-ID resumption and TLS 1.3 ticket/PSK resumption. This aligns with the behavior introduced in PR #10489 (checking SNI/ALPN on resumption) by adding the previously missing ALPN-mismatch coverage.
Changes:
- Add a TLS 1.2 session-ID resumption test that verifies resumption is not used when ALPN changes between the original connection and the attempted resumption.
- Add a TLS 1.3 ticket-based resumption test that verifies resumption is not used when ALPN changes between the original connection and the attempted resumption.
- Register the new tests in the API test declarations header so they run with the existing
tests/apisuite.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/api/test_tls.h |
Registers the two new ALPN mismatch resumption tests in the TLS API test list. |
tests/api/test_tls.c |
Implements TLS 1.2 and TLS 1.3 resumption ALPN-mismatch regression tests using the existing memio harness. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
douzzer
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Add unit tests that TLS resumption fails due to ALPN mismatch
This is related to #10489 and just adds a missing unit test case.
Fix F-4141
Testing
How did you test?
Checklist