Skip to content

fix(oak_session): disable TLS resumption with client auth - #5168

Open
secsson wants to merge 2 commits into
project-oak:mainfrom
secsson:fix/tls-client-auth-resumption
Open

fix(oak_session): disable TLS resumption with client auth#5168
secsson wants to merge 2 commits into
project-oak:mainfrom
secsson:fix/tls-client-auth-resumption

Conversation

@secsson

@secsson secsson commented Sep 5, 2026

Copy link
Copy Markdown

Summary

  • disable TLS session tickets on client-authenticated C++ server connections;
  • add an mTLS regression test that counts outgoing session tickets; and
  • document why C++ client-authenticated servers do not support session resumption.

Closes #5167

Problem

OakSessionTlsContext retains one server SSL_CTX, while NewSession() resolves current trust anchors and attaches the custom verifier to each new SSL. A TLS 1.3 ticket created under an earlier client-authentication policy can therefore resume without a new client certificate check after the policy changes.

This affects servers that keep a context alive while rotating client trust anchors or changing a stateful verifier decision. The supplied reproduction records that an old-ticket connection succeeds after revocation while the same client without the ticket is rejected. No production C++ consumer has been demonstrated.

Fix

Set SSL_OP_NO_TICKET on each server-side SSL when SSL_VERIFY_PEER is enabled. Applying the option per connection avoids mutating the shared context and leaves servers without client authentication unchanged.

The README now makes the behavior explicit: C++ servers requiring client authentication perform a fresh authentication exchange for each new connection so current trust anchors and verifier policy are applied.

Tests

  • Added ClientAuthenticatedServerDoesNotIssueSessionTickets, which completes an mTLS handshake with a session-cache-capable client and counts outgoing server tickets.
  • Negative control: with the fix removed, the new test fails because BoringSSL emits two NewSessionTicket messages.
  • Fixed control: with the fix restored, the new test observes zero tickets.
  • bazel test //oak_session/tls:oak_session_tls_test --test_output=errors passes.
  • git diff --check passes.
  • The original standalone policy-rotation PoC was not rerun because its files and logs were unavailable.

Compatibility

There is no public API or framing change. Servers without client authentication retain their existing behavior. Client-authenticated C++ servers intentionally lose TLS session-resumption performance and require a fresh certificate exchange on reconnect so revocation and policy rotation take effect.

@google-cla

google-cla Bot commented Sep 5, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@jblebrun

jblebrun commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for this fix!

Please run just format on the change set (it should result in a small change in the README.md file).

@secsson

secsson commented Sep 9, 2026

Copy link
Copy Markdown
Author

Thanks for this fix!

Please run just format on the change set (it should result in a small change in the README.md file).

Ran just format and pushed the resulting README change. Thanks!

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.

C++ TLS resumption can bypass refreshed client-authentication policy

2 participants