avoid race condition by making OpenSSL thread safe
deadlock fix