|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33760 cURL needs to implement CRYPTO_callback functions to prevent locking
Submitted: 2005-07-19 00:48 UTC Modified: 2005-10-25 16:46 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: eja40 at cam dot ac dot uk Assigned: mike (profile)
Status: Closed Package: cURL related
PHP Version: 5CVS, 4CVS, 6CVS OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: eja40 at cam dot ac dot uk
New email:
PHP Version: OS:


 [2005-07-19 00:48 UTC] eja40 at cam dot ac dot uk
I am experiencing problems when using multi-threaded cURL requests.

When I have more than about 5 threads connecting using HTTPS, all subsequent threads fail to connect (regardless of the timeout used).

I presume this is because PHP hasn't implemented the CRYPTO_callback functions to prevent OpenSSL locking.

Sorry I have no idea how to implement this fix myself - but the solution to the problem is elaborated here:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-20 15:12 UTC] eja40 at cam dot ac dot uk
Sorry I don't know how to patch it myself.
However cURL insist that this must be implemented at the highest thread level - it cannot be implemented in libcurl (I don't understand why). Therefore it must be implemented in the PHP code.
 [2005-07-20 15:18 UTC] eja40 at cam dot ac dot uk
To help flesh out this problem and the solution - the example OpenSSL locking code is given by cURL here:
 [2005-07-28 00:46 UTC] daniel-curl at haxx dot se
This is clearly documented in the libcurl tutorial and has been required by libcurl for years.

Available online here:

Certainly we are open for other/new solutions, but that doesn't fix this problem for you for older libcurl installations.
 [2005-10-24 00:09 UTC]
Mike, since you got this thing to work with pecl/http could you have a look at implementing the callbacks in the curl extension?

 [2005-10-24 10:10 UTC]
Patch against PHP_5_1:

 [2005-10-24 10:27 UTC]
Ah, I forgot to mention that the GnuTLS implementation is quite academic, i.e. untested.

 [2005-10-25 16:46 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Mar 27 08:03:43 2023 UTC