cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: HTTPS request with curl library gives "out of memory" error

From: Ambarish Mitra <ambarish_mitra_at_persistent.co.in>
Date: Tue, 15 Jan 2008 15:55:06 +0530

That was close, the latest released curl version is 7.17.1 :)

--- I already have a 7.16.0 version in the same project application, and I
cannot convince them to upgrade now- we cannot have 2 versions of the same
library in the same application. :-)

IOW openSSL's SSL_CTX_new() failed, libcurl interprets this as an out of
memory condition, which may or may not be true (I've never programmed
with openSSL, so I don't know and can't provide a patch right now).

--- I have figured out the cause. The application was linking with some
other library, which again linked with the openssl library. Therefore, the
SSL_CTX_new symbol resolved to the other call. A couple of things were done
to diagnose this error. 1) Right after the SSL call failure, I added the
following code:

      unsigned long ErrCode = ERR_get_error();
        char ErrBuf[120];
        ERR_error_string(ErrCode, ErrBuf);
        fprintf(stderr, "[%s]\n", ErrBuf);

and it gave me the output: [error:1A09400E:SSLCERT routines:STORE_NEW:not
supported]

This gave a hint that the symbol searching was not proper. 2) Then running a
strace with LD_DEBUG=bindings showed how the call resolved to the other
library.

But the problem you're seeing is caused by openSSL. Download the latest
libcurl source, improve the error message in libcurl's ssluse.c to see
what's openSSL really complaining about, fix the issue with openSSL and
post the ssluse.c patch here if you find out that SSL_CTX_new() can
really fail due to other than memory reasons ;)

--- So, there is nothing to fix because nothing is broken.

Thanks for all those who have taken their time on this.

// Pls ignore the disclaimer.

DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
Received on 2008-01-15