logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: When/where does the SSL session created?
Author
totszwai



Joined: 18 Aug 2016
Posts: 3
Location: Quebec

PostPosted: Mon 22 Aug '16 19:50    Post subject: When/where does the SSL session created? Reply with quote

Hi guys,

I'm trying to store some variables into the SSL session cache, but i can't seems to pinpoint when/where the SSL session cache is generated.

I think I was able to store the data into the cache, but when i pull the value out, they are different...

I've added this custom struct in the ssl_private.h:
Code:

typedef struct test_data_st {
    int a;
    int b;
} TEST_SESSION_DATA;

static int test_sess_data_idx = -1;


I'm not entirely sure where to save the data yet, but currently I'm doing it in the ssl_hook_Fixup:
Code:

        if (test_sess_data_idx == -1)
        {
            test_sess_data_idx = SSL_SESSION_get_ex_new_index(0, "MY DATA", NULL, NULL, NULL);
        }

        SSL_SESSION *sess = (SSL_session_reused(ssl) ? SSL_get_session(ssl) : NULL);
        if (sess)
        {
            TEST_SESSION_DATA * td = NULL;
            td = (TEST_SESSION_DATA *) SSL_SESSION_get_ex_data(sess, test_sess_data_idx);
           
            int valid = 0;
            if (td == 0)
            {
                TEST_SESSION_DATA d;
                d.a = 1;
                d.b = 1;
                SSL_SESSION_set_ex_data(sess, test_sess_data_idx, &d);
            }       
         }
         else
         {
                ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, "a: %d", td->a);
                ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r, "b: %d", td->b);
         }
 


The values I'm getting back are like:
Quote:
[Fri Aug 19 06:26:32 2016] [info] a: 1569085104
[Fri Aug 19 06:26:32 2016] [info] b: 32767


Anyone know at which step is the SSL session cache created?

edit: apache 2.2
Back to top
jimski



Joined: 18 Jan 2014
Posts: 196
Location: USSA

PostPosted: Wed 07 Sep '16 21:33    Post subject: Reply with quote

The SSL sessions are not cached unless you have installed and configured a session caching module such as mod_socahce_memcache. Then depending on the type of caching module the location of the cahce will differ and it can be a file, a memory location or an external store.
Back to top


Reply to topic   Topic: When/where does the SSL session created? View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads