cURL / Mailing Lists / curl-library / Single Mail

curl-library

ssl

From: T. Bharath <TBharath_at_responsenetworks.com>
Date: Mon, 28 May 2001 08:34:23 -0400

Regarding use of SSL in libCurl i find that
SSL_load_error_strings(); and
SSLeay_add_ssl_algorithms();
are called in Curl_SSLConnect().(i use a older version 7.4 so i found
them in UrgSSLConnect)
These two functions are to be called once in a process
Now consider a scenario involving multiple threads, where
Curl_SSLConnect() gets called in multiple threads these functions are
invoked many times.Iam really not sure the implications of invoking the
functions mutiple times but one thing is we dont call the clean up
functions causing leakage(i couldnt find them in the current version
either)
ERR_remove_state(0);(this is thread specific and has to be called in
every thread that uses the ssl lib)
EVP_cleanup();
ERR_free_strings();

Iam using a older version of the libCurl so i tried placing them in
urlfree() (iam not sure where you place them inthe recent version)but
this was leading to a crash when multiple threads were involved since
EVP_cleanup();
ERR_free_strings(); should be called only on application cleanup.
So the best option was to remove
SSL_load_error_strings(); and
SSLeay_add_ssl_algorithms();
from Curl_SSLConnect() and put them in a global function that gets
called only once at application startup and put the clean up routines
EVP_cleanup();
ERR_free_strings();
in another global function that has to be called on application exit.
and retain ERR_remove_state(0) in urlfree() since this is needed for
thread clean up
I cannot send a diff since iam not using the latest version

Regards
Bharath

_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-05-28