Skip to content

Fix user_agent_session_miss for ATS SSL session cache #12405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bneradt
Copy link
Contributor

@bneradt bneradt commented Jul 30, 2025

proxy.config.ssl.session_cache.value allows the user to configure whether OpenSSL internally manages the TLS session cache for resumption or whether ATS does via callbacks. For our user_agent_session_* metrics, we use the SSL_CTX_sess_* OpenSSL API to populate them. This works for hit, timeout, etc, for both when the session cache is managed by OpenSSL and when it is managed by ATS, with the exception of SSL_CTX_sess_misses. That metric only counts internal cache misses:

SSL_CTX_sess_misses() returns the number of sessions proposed by
clients that were not found in the internal session cache in server
mode.

The result is that when ATS manages the session cache, which is the default configuration, proxy.process.ssl.user_agent_session_miss is always zero. This patch uses our ssl_session_cache_miss metric to augment the stat to be accurate for ATS-managed caching.

@bneradt bneradt added this to the 10.2.0 milestone Jul 30, 2025
@bneradt bneradt self-assigned this Jul 30, 2025
proxy.config.ssl.session_cache.value allows the user to configure
whether OpenSSL internally manages the TLS session cache for resumption
or whether ATS does via callbacks. For our user_agent_session_* metrics,
we use the SSL_CTX_sess_* OpenSSL API to populate them. This works for
hit, timeout, etc, for both when the session cache is managed by OpenSSL
and when it is managed by ATS, with the exception of
SSL_CTX_sess_misses. That metric only counts internal cache misses:

> SSL_CTX_sess_misses() returns the number of sessions proposed by
> clients that were not found in the internal session cache in server
> mode.

The result is that when ATS manages the session cache, which is the
default configuration, proxy.process.ssl.user_agent_session_miss is
always zero. This patch uses our ssl_session_cache_miss metric to
augment the stat to be accurate for ATS-managed caching.
@bneradt bneradt force-pushed the fix_ssl_user_agent_session_miss_for_external_cache branch from 6f58e64 to fa32d52 Compare July 30, 2025 21:10
@bneradt bneradt requested a review from maskit August 4, 2025 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant