just use the sess from argument and make sure only retain the ref count if inserted in cache
@@ -972,16 +972,15 @@ int h2o_socket_ssl_new_session_cb(SSL *s, SSL_SESSION *sess)
SSL_SESSION *session = NULL;
if (!SSL_is_server(s) && sock->ssl->handshake.client.session_cache != NULL) {
- session = SSL_get_session(sock->ssl->ossl);
#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
- if (SSL_SESSION_is_resumable(session))
+ if (SSL_SESSION_is_resumable(sess)) {
#endif
+ session = sess;
h2o_cache_set(sock->ssl->handshake.client.session_cache, h2o_now(h2o_socket_get_loop(sock)),
sock->ssl->handshake.client.session_cache_key, sock->ssl->handshake.client.session_cache_key_hash,
h2o_iovec_init(session, 1));
#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
- else
- session = NULL;
+ }
#endif
}
