Do you have session cache enabled? I have had the same suspicion in the
past.
Following links may be usefull.
http://www.openssl.org/docs/ssl/SSL_CTX_set_session_cache_mode.html
http://www.openssl.org/docs/ssl/SSL_CTX_set_timeout.html#

-VJ
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jason Resch
Sent: Monday, February 06, 2006 7:16 AM
To: openssl-users@openssl.org
Subject: Memory leak in OpenSSL application

Hello everyone,

My company has been working on an SSL enabled server application, and we
have recently encountered a memory leak bug which appears to lead to the
eventual crash of the server.  We ran a test having a client application
do nothing but connect to the server application and close the
connection.  After about 2,000 connections the server grows by about 50
MB and then it crashes.

I've been doing some research into this and so far the main cause seems
to be that we were not calling SSL_free after each connection closed.  
 From what I have gathered, the correct way to cleanup after a
connection is to call the following functions in this order:

    SSL_shutdown(ssl);
    SSL_free(ssl);
    close(socket);

My main reason for writing this e-mail is that I wanted to make sure I
wasn't missing anything as far as cleaning up after each connection.  
Are there any other functions I should be calling to prevent memory
leaks?  I would be grateful to hear from anyone who is experienced in
this area.  Thank you in advance.

Best Regards,

Jason Resch


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

Reply via email to