From 65a50b87ac0e825dad3240e0ae27c6e6c153f287 Mon Sep 17 00:00:00 2001 From: Mo Chen Date: Mon, 14 Feb 2022 11:52:42 -0600 Subject: [PATCH] TLS Session Resumption: fix timed out session A recent to use shared_ptr for sessions change modified the behavior of timed out sessions in getOriginSession(). This change reverts the behavior of getOriginSession() for a timed out session to the previous behavior, where it returns a null session pointer. --- iocore/net/TLSSessionResumptionSupport.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/iocore/net/TLSSessionResumptionSupport.cc b/iocore/net/TLSSessionResumptionSupport.cc index af22b2e8959..36cfbb5d0af 100644 --- a/iocore/net/TLSSessionResumptionSupport.cc +++ b/iocore/net/TLSSessionResumptionSupport.cc @@ -184,6 +184,7 @@ TLSSessionResumptionSupport::getOriginSession(SSL *ssl, const std::string &looku if (is_ssl_session_timed_out(shared_sess.get())) { SSL_INCREMENT_DYN_STAT(ssl_origin_session_cache_miss); origin_sess_cache->remove_session(lookup_key); + shared_sess.reset(); } else { SSL_INCREMENT_DYN_STAT(ssl_origin_session_cache_hit); this->_setSSLSessionCacheHit(true);