[Bug 1823] Problem with TLS: threads and OpenSSL