This is a discussion on Re: Static global - bug? (Re: Two valgrind warnings in OpenSSL -possible bug???) - Openssl ; Tomas Mraz, 2008-01-24:
> So IMO what Paul Sheer is doing - disabling all locking in OpenSSL given
> that there won't be any static and/or global variables in the OpenSSL
> code called is 100% safe thing if the ...

Tomas Mraz, 2008-01-24:
> So IMO what Paul Sheer is doing - disabling all locking in OpenSSL given
> that there won't be any static and/or global variables in the OpenSSL
> code called is 100% safe thing if the threads do not share any data
> manipulated within the OpenSSL library.

As mentioned in the docs, multithreaded OpenSSL needs special
application support, period. Not providing this means you'll
get undefined/undesirable results.

Old MySQL versios did try this approach (i.e. using the library
in an undocumented way). Perhaps it sort-of worked for them
while they developed the SSL support for the database engine,
but newer MySQL/OpenSSL combinations didn't work at all (for
example, MySQL-4.0.23a+OpenSSL-0.9.7c). They fixed it, albeit a
few years down the road.

Separately, I'd suggest a different development approach: first,
implement OpenSSL locking support. Do some measurements, with
and without locking. I'd be interested to get some quantitative
evidence before proceeding with this thread.