You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix multiple issues in TLS session caching implementation
This commit addresses several issues identified in the TLS session caching feature:
1. SNI endpoint cache key collision: Added tls_session_cache_key property
to EndPoint classes. SniEndPoint now includes server_name in the cache
key to prevent collisions when multiple SNI endpoints use the same proxy.
2. TLS session caching for eventlet/twisted reactors: Added PyOpenSSL-based
session caching support in EventletConnection and TwistedConnection
(via _SSLCreator) to enable TLS session resumption for these reactors.
3. Missing hasattr check: Added hasattr check for session_reused attribute
before accessing it, as not all SSL socket implementations have it.
4. Automatic cleanup of expired sessions: Added opportunistic cleanup in
set_session() that runs every 100 operations to prevent memory
accumulation from expired sessions.
5. Log message formatting: Changed log messages to use endpoint's __str__
method instead of manually formatting address:port, which handles
UnixSocketEndPoint (port=None) correctly.
6. Custom TLSSessionCache support: Updated Cluster to accept either
TLSSessionCacheOptions or a TLSSessionCache instance directly,
allowing users to provide custom cache implementations.
0 commit comments