cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: SSL: couldn't create a context! Errors

From: David Justl <david_at_rockauto.com>
Date: Thu, 29 Jan 2009 13:47:32 -0600

David Justl wrote:
> So it looks like somehow the OpenSSL hash that's supposed to store the
> ciphers and digests is sometimes empty when SSL_CTX_new is called by
> cURL. Are there any known issues when running cURL under Apache+PHP
> where the Apache process is also using OpenSSL? I seems like
> something is clearing this hash ("EVP_cleanup"?) but nothing
> re-populates it if cURL needs to create a new context. Not sure if
> this makes any sense, but just trying to figure out what may be going on.
>
> Thanks,
> Dave
>
> Daniel Stenberg wrote:
>> On Thu, 15 Jan 2009, David Justl wrote:
>>
>>> Thanks for the quick response. I added code to return the OpenSSL
>>> error string when this failure occurs (It would be nice if cURL
>>> returned this instead of the generic 'Couldn't create a context'
>>> error), and this is what I got:
>>>
>>> error:140A90F1:SSL routines:SSL_CTX_new:unable to load ssl2 md5
>>> routines
>>
>> We'll welcome patches that improves libcurl in this aspect!
>>
>>> I'm not sure what could be causing this problem...is there anything
>>> that can be done in cURL to help with this? Or do I just need to
>>> ask the OpenSSL people?
>>
>> Since it explictly mentions ssl2 I figure you could try to explictly
>> try sslv3 or tlsv1 to work around this. Other than so I don't really
>> know...
>>

It appears that this isn't necessarily a problem with just cURL. I
modified our code to use PHP's 'fopen' to send the HTTPS requests and
even that randomly fails with a "Failed to enable crypto" error. So it
seems to be a bug in Apache, OpenSSL, or PHP itself. Maybe PHP is using
mutexes in a way that's not 100% compatible with Apache? I'll try other
OpenSSL and PHP forums to see if anyone else has seen this. It looks
like I'm the only one who's seen it on this board at least.

    Thanks,
    Dave
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-01-29