fwingx has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I was using the Net::SSLeay module to make the ssl connection. I want to make my ssl client to re-use the session-id, so I found that the function Net::SSLeay::copy_session_id($to, $from) can do that. But both $to and $from are the openssl's SSL structure, they are one integer in perl. My quesion is how to store the openssl's SSL structure into file or perl scalar? After storing the openssl's SSL structure, the next time it will be able to be gotten and then used to do the ssl session reuse.
  • Comment on How to store the openssl's SSL structure in perl Net::SSLeay

Replies are listed 'Best First'.
Re: How to store the openssl's SSL structure in perl Net::SSLeay
by Corion (Patriarch) on Aug 07, 2013 at 06:57 UTC

    What you want is just not possible. The openssl SSL structure lives in the openssl library and only an integer (likely, a pointer to the C structure) is exported to Perl.

    I wonder why you want to store the SSL structure in a file? A socket connection does usually not survive if the program that created it exits. You will have to recreate the connection every time your program runs.

      Yes, every time my program runs, one socket connection is create. But for thie new socket connection, I want to use one existent session id for the ssl layer. And then the ssl session reuse function will work.

        That's not possible.