cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: thread safe use of openssl

From: <jose.c.baars_at_nl.abnamro.com>
Date: Tue, 16 Dec 2003 14:07:34 +0100

When I tried to run a slightly adapted version of multithread.c out of the
examples with https url's it failed miserably on our VMS test system.

I got 6, unable to resolve host ( how do you build curl with ares
support??)
or 27 , unable to create SSL context or just core ( stack on VMS ) dumps,
usually
in Curl_SSLconnect.

If I put a sleep(4) in the loop that creates the threads, it works ok.

(See attached file: mt.c)
Btw. the OpenSSL docu is rather blunt. It says at least the 2 static
locking routines should
be provided when running OpenSSL in a multithreaded environment.

All in all, Jose Chung might be right that something needs to be done.
regards,
Jose

|---------+---------------------------------------->
| | Daniel Stenberg |
| | <daniel-curl_at_haxx.se> |
| | Sent by: |
| | curl-library-admin_at_lists.sour|
| | ceforge.net |
| | |
| | |
| | 12/16/2003 11:24 AM |
| | Please respond to |
| | curl-library |
| | |
|---------+---------------------------------------->
>--------------------------------------------------------------------------------------------------------|
  | |
  | To: libcurl Mailing list <curl-library_at_lists.sourceforge.net> |
  | cc: |
  | Subject: Re: thread safe use of openssl |
>--------------------------------------------------------------------------------------------------------|

On Tue, 16 Dec 2003, jose chung wrote:

> Based on my perusal of the CURL code, it doesn't seem like it uses
OpenSSL
> in a thread safe manner as it does not implement either the static
locking
> or dynamic locking callbacks.

I've been under the impression that our use of OpenSSL does not warrant
those
locking methods. I take your mail here as a saying that we do.

I find that odd, since I believe we have lots of users who have used
libcurl
multi-threaded for HTTPS transfers...

> Since I couldn't find it, and since I had problems using HTTPS in CURL
with
> multithreaded apps, I've implemented static and dynamic locking for VMS,
> AIX, and Win32 into CURL.

I don't want locking methods inside libcurl, since locking is a
multi-platform
nightmare. The share interface was added for sharing data between multiple
threads, and I figure we could indeed use that interface for locking/share
SSL
resources as well should this be determined to be necessary.

> I'm not certain if CURL has intentionally left this as an exercise for
the
> user, but if it hasn't, I'd be happy to contribute what I have.

I would inded be interested, but we should perhaps first clear out what the
problems you've been experiencing resulted in and that this locking is
really
necessary.

--
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
---------------------------------------------------------------------------
This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender by
return e-mail and delete this message from your system. Any unauthorised
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change.
ABN AMRO Bank N.V. (including its group companies) shall not be liable for
the improper or incomplete transmission of the information contained in
this communication nor for any delay in its receipt or damage to your
system. ABN AMRO Bank N.V. (or its group companies) does not guarantee that
the integrity of this communication has been maintained nor that this
communication is free of viruses, interceptions or interference.
---------------------------------------------------------------------------

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click

  • application/octet-stream attachment: mt.c
Received on 2003-12-16