Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increment session hit counter for ticket resumptions (#1320)
OpenSSL increments session hits in two places: 1. Handshake finish [on the client side](https://github.com/openssl/openssl/blob/1750689767cc922bdbe73358f7256475f0838c67/ssl/statem/statem_lib.c#L1494) 2. Fetching potentially pre-existing session [on the server side](https://github.com/openssl/openssl/blob/1750689767cc922bdbe73358f7256475f0838c67/ssl/ssl_sess.c#L665) Prior to this change, we failed to increment the session "cache" hit counter for TLS 1.3 servers. I put "cache" in scare-quotes because whether that behavior is correct depends on how you define a cache, as TLS 1.3 ticket resumption is stateless and doesn't require a true session cache. Semantics aside, the change in this PR conforms to OpenSSL's behavior. OpenSSL [documents](https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_sess_hits.html) session hit counts as: > SSL_CTX_sess_hits() returns the number of successfully reused sessions. In client mode a session set with [SSL_set_session(3)](https://www.openssl.org/docs/man1.1.1/man3/SSL_set_session.html) successfully reused is counted as a hit. In server mode a session successfully retrieved from internal or external cache is counted as a hit.
- Loading branch information