Hi, I'm having a hard time getting server-side session caching to work. The context is that I'm developing both server (multithreaded) & client (single threaded) using TLSv1 (OpenSSL 0.9.7a). Server has SSL_CTX_set_session_id_context() and both client and server set SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_BOTH).
The server never reuses a session, reporting every connection as a cache miss (also reporting SSL_CTX_sess_number(ctx)==0 always). I've instrumented it with dummys for new_session_cb() and get_session_cb() which basically dump the session to sdtout and look at the internal cache by means of SSL_has_matching_session_id(). Here is a trace from my app (chopped for brevity): client: makes first connection. server: looks for session in caché: not found (ok, it's the first one) server: adds session to cache: Protocol : TLSv1 Cipher : DHE-RSA-AES256-SHA Session-ID: 15527457E52A110BCDEE12EFCECC76D934B4891211D66307C22831A5467EA0B4 Session-ID-ctx: 01000000 client: adds session to cache. client: closes connection. client: new connection. client: looks for session in cache, sets it with SSL_set_session(): SSL-Session: Protocol : TLSv1 Cipher : DHE-RSA-AES256-SHA Session-ID: 15527457E52A110BCDEE12EFCECC76D934B4891211D66307C22831A5467EA0B4 Session-ID-ctx: (seems OK so far) server: looks for session in cache: 15527457E52A11BCDEE12EFCECC76D934B4891211D6637C22831A5467EA0B4 not found! Does anybody see something obvious missing or has any idea about what could be happening? Thanks! Regards. Fernando. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]