php.net |  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
Votes:2
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
Status: Closed Package: cURL related
PHP Version: 5CVS, 4CVS, 6CVS OS: *
Private report: No CVE-ID:
 [2005-07-19 00:48 UTC] eja40 at cam dot ac dot uk
Description:
------------
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:
http://curl.haxx.se/mail/lib-2004-06/0086.html


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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:

http://curl.haxx.se/lxr/source/docs/examples/opensslthreadlock.c
 [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:

http://curl.haxx.se/libcurl/c/libcurl-tutorial.html#Multi-threading

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] edink@php.net
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] mike@php.net
Patch against PHP_5_1: http://dev.iworks.at/PATCHES/curl_ssl_tsl.diff.txt

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

 [2005-10-25 16:46 UTC] mike@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 13:02:15 2014 UTC