cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Problem with curl_global_init(CURL_GLOBAL_SSL)

From: Johan Antonsson <Johan.Antonsson_at_ibitec.se>
Date: Sat, 22 May 2004 02:02:42 +0200

Thanks Daniel,

You wrote:
> But the SSL bit should be set unless you have initialized the OpenSSL library already in some other way.

Ok, that gives me a clue. I'm also using Corba (TAO) over SSL in another function which I was calling first. That's why SSL worked. So my problem occurs when initializing SSL a second time with curl_global_init(CURL_GLOBAL_SSL). The other way seem to work fine, i.e. first initialize via Curl and than via Corba. That doesn't corrupt Matlabs memory. If one can reuse the initialization this way, shouldn't Curl be able to notice that SSL is already initialized, or is it all up to SSL? Or is there a way to find out if SSL is initialized, that you know of?

Regards,

/Johan
_______________________________________
Ibitec Development Partner
Olaus Magnus väg 44 Tel: 013-376700
S-583 30 Linköping Web: www.ibitec.se
_____________________________________­__

-----Original Message-----
From: curl-users-bounces_at_cool.haxx.se [mailto:curl-users-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: den 21 maj 2004 22:11
To: curl tool talk
Subject: Re: Problem with curl_global_init(CURL_GLOBAL_SSL)

On Fri, 21 May 2004, Johan Antonsson wrote:

(I generally recommend using the curl-library list for libcurl talk)

> I'm using Curl 7.11.1 (libcurl) and OpenSSL 0.9.6l under Win32
> together with Matlab. Using libcurl from a C-program (dll) that is
> loaded by Matlab. When initializing Curl with
> curl_global_init(CURL_GLOBAL_DEFAULT) (i.e CURL_GLOBAL_SSL | CURL_GLOBAL_WIN32), Matlab:s memory becomes corrupted.
> After lots of debugging I finally discover that when using
> curl_global_init(CURL_GLOBAL_WIN32) the problem disappear and SSL is
> still working.

Very weird. It makes it sounds like an OpenSSL bug.

> Can anyone explain to me why SSL is still working

Nope, since the documented functions haven't been called then. But they might have some way to do it automaticly nowadays.

> and what flags I should use with SSL?

To do what?

> The documentation doesn't say much about this. Has anyone else
> experienced similar problems when using the CURL_GLOBAL_SSL flag?

The docs might be a bit sparse in this ares, yes. But the SSL bit should be set unless you have initialized the OpenSSL library already in some other way.

> What about LINUX and e.g. CURL_GLOBAL_WIN32? The same flags seem to be
> defined in curl.h on all platforms.

It is defined on all platforms, but the *WIN32 is ignored on all platforms that don't care. The *SSL one is similarly ignored by all libcurls that are built without SSL...

-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-05-22