Reputation: 121
I want to resume SSL session when I do interactive with server.
I found example in tutor (An introduction to OpenSSL programming PartII), but doubt whether it is correct.
I have no idea with close(sock)
. I doubt if I close TCP connection, session resumption can be successfully?
Thx!
Upvotes: 0
Views: 564
Reputation: 6122
The example is correct. Session resumption allows you to resume the session with a server on a new connection. In the example above, the session is saved using SSL_get1_session
in the variable sess
. The session is then resumed on the new connection by using SSL_set_session
. http://vincent.bernat.im/en/blog/2011-ssl-session-reuse-rfc5077.html has a pretty good explanation of how session resumption works.
Upvotes: 2