Help please.

I have a program/parent thread that launches 4 child threads. It's a Win32 application that has to be linked using the /MT VC compiler option for reasons other than OpenSSL. The parent thread calls the following OpenSSL calls.

CRYPTO_malloc_init();
SSL_library_init();
SSL_load_error_strings();
RAND_seed();
ERR_free_strings();

Two of the 4 child threads make OpenSSL calls. One child thread is a very simple single-threaded HTTPS web server. One child thread is a very simple single-threaded HTTPS web browser.

As per the OpenSSL FAQ (http://www.openssl.org/support/faq.html#PROG1), do I need to implement the CRYPTO_set_locking_callback() and CRYPTO_set_id_callback() functions?

Quoted from the FAQ: "Multi-threaded applications must provide two callback functions to OpenSSL by calling CRYPTO_set_locking_callback() and CRYPTO_set_id_callback(). (For OpenSSL 0.9.9 or later, the new function CRYPTO_set_idptr_callback() may be used in place of CRYPTO_set_id_callback().) This is described in the threads(3) manpage."

I was thinking that since these child threads are not multi-threaded, then I may not need to implement these functions? However, since I've had to use the /MT option in VC and since the program/parent thread does have children threads, then maybe I do?

NOTE: I am linking with the the non-static versions of libeay32MT.lib and ssleay32MT.lib in MS Visual C++ v6.

In any case, does it hurt anything if I try to implement these two OpenSSL functions anyway? And, if it's quick and easy to do, can someone sent code snippets of implementations of these two functions?

Thanks a million... again! Love this OpenSSL stuff!

Joe

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

Reply via email to