hi there,

I hope you will help me again:
How do I reuse a SSL-Session on the client-side?
I'm writing a Http-SSL-Client based on Open-SSL.
I do a simple socket connect, then use SSL-connect on the socket.
This is where (in my opinion) Open-SSL and the Webserver are creating a SSL-Session.
On webserver-side this is taking a lot of cpu-power.
After a request, the webserver shuts down the connection.
So I do a new socket-connect.
An little example of code is at the end of this message.
My Question is: What will I have to do to reuse the previously created SSL-Session?

thanks in advance,


And here's the code-example (without any errorhandling)

SSL_CTX     *ctx;
SSL_METHOD  *meth;
SSL         *ssl;

meth=SSLv3_client_method();
ctx = SSL_CTX_new (meth);

while (true)
{
   /*
   ...do normal socket-connect... --> get socketdescriptor fd
   */

   ssl = SSL_new (ctx);
   SSL_set_fd (ssl, fd);
   SSL_connect(ssl);

   /*
   ... communication (read, write)
   */

   /*
   ... Socket close
   */

   SSL_CTX_free(ctx);
   SSL_shutdown(ssl);
   SSL_free (ssl);
}


Silvio Matthes

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to