cURL / Mailing Lists / curl-library / Single Mail

curl-library

anonymous SSL

From: Serge van den Broek <SVandenbroek_at_ISABEL.BE>
Date: Tue, 8 Jun 2004 09:47:11 +0200

Dear sir

You are right, I could be more precise in my request for information.

I use cURL version 7.10.8, and I develop with Visual Studio C++ 6 on windows 2000. The prototype was written a few months ago, and it works quite well in normal http. This prototype has been written by trying to understand how the examples work and of course by reading carefully the doc. As far as I remember, I didn't encounter any special problem to build the application, once of course the project did point correctly to the directory where the cURL lib resides. By this information, I mean: no special key, no special instruction to build the application.

Hence my question: what modification should I bring to this procedure to build the library with SSL features ? This is really not clear for me.

Thanks for your help.

----------------------------------------------------
Serge van den Broek
Senior Analyst Programmer
* svandenbroek_at_isabel.be
* : +32 (02) 545.17.67 * : +32 (02) 545.17.19
Isabel SA
Blvd. de l'Impératrice 13-15
B - 1000 Bruxelles
Web : www.isabel.be

DISCLAIMER : Confidential information may be contained in this message
and it may be legally privileged. If you are not the addressee
indicated in this message (or responsible for delivery of the message to
such person), you may not copy or deliver this message to anyone. In
such case, you should destroy this message and kindly notify the sender
by reply email. Please advise immediately if you or your employer does
not consent to Internet email for messages of this kind. Opinions,
conclusions and other information in this message that do not relate to
the official business of Isabel shall be understood as neither given nor
endorsed by it. Messages and attachments are swept by a virusscanner. If
this message contains password-protected attachments, the files have not
been scanned for viruses by the Isabel mail domain. Always scan
attachments before opening them.

-----Original Message-----
From: curl-library-request_at_cool.haxx.se
[mailto:curl-library-request_at_cool.haxx.se]
Sent: lundi 7 juin 2004 23:27
To: curl-library_at_cool.haxx.se
Subject: Curl-library Digest, Vol 5, Issue 13

Send Curl-library mailing list submissions to
        curl-library_at_cool.haxx.se

To subscribe or unsubscribe via the World Wide Web, visit
        http://cool.haxx.se/mailman/listinfo/curl-library
or, via email, send a message with subject or body 'help' to
        curl-library-request_at_cool.haxx.se

You can reach the person managing the list at
        curl-library-owner_at_cool.haxx.se

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Curl-library digest..."

Today's Topics:

   1. RE: Curl-library Digest, Vol 5, Issue 12 (Serge van den Broek)
   2. building with OpenSSL (Daniel Stenberg)
   3. Re: AIX multithreaded issue - CURLE_COULDNT_CONNECT
      (Joseph Anto Smith)
   4. Re: AIX multithreaded issue - CURLE_COULDNT_CONNECT
      (Daniel Stenberg)
   5. Re: AIX multithreaded issue - CURLE_COULDNT_CONNECT
      (Joseph Anto Smith)
   6. Re: AIX multithreaded issue - CURLE_COULDNT_CONNECT (Tor Arntsen)
   7. hang with NTLM auth on both proxy and host during upload
      (David Byron)
   8. binary mode on Win32 but LF becomes CRLF (Rowe David W.)

----------------------------------------------------------------------

Message: 1
Date: Mon, 7 Jun 2004 12:35:56 +0200
From: "Serge van den Broek" <SVandenbroek_at_isabel.be>
Subject: RE: Curl-library Digest, Vol 5, Issue 12
To: <curl-library_at_cool.haxx.se>
Message-ID: <7CAD3B6DB983934C874E46A8CD4AE2B760B937_at_server1e>
Content-Type: text/plain; charset="iso-8859-1"

Thanks for your fast answer.

Compiling with openSSL, that's what I understood when I looked for information on the web. But it isn't clear for me how to do this. Does it need an extra library (I read something about libeay.lib, for example) ?

Thanks again

----------------------------------------------------
Serge van den Broek
Senior Analyst Programmer
* svandenbroek_at_isabel.be
* : +32 (02) 545.17.67 * : +32 (02) 545.17.19
Isabel SA
Blvd. de l'Impératrice 13-15
B - 1000 Bruxelles
Web : www.isabel.be

DISCLAIMER : Confidential information may be contained in this message
and it may be legally privileged. If you are not the addressee
indicated in this message (or responsible for delivery of the message to
such person), you may not copy or deliver this message to anyone. In
such case, you should destroy this message and kindly notify the sender
by reply email. Please advise immediately if you or your employer does
not consent to Internet email for messages of this kind. Opinions,
conclusions and other information in this message that do not relate to
the official business of Isabel shall be understood as neither given nor
endorsed by it. Messages and attachments are swept by a virusscanner. If
this message contains password-protected attachments, the files have not
been scanned for viruses by the Isabel mail domain. Always scan
attachments before opening them.

-----Original Message-----
From: curl-library-request_at_cool.haxx.se
[mailto:curl-library-request_at_cool.haxx.se]
Sent: lundi 7 juin 2004 12:00
To: curl-library_at_cool.haxx.se
Subject: Curl-library Digest, Vol 5, Issue 12

Send Curl-library mailing list submissions to
        curl-library_at_cool.haxx.se

To subscribe or unsubscribe via the World Wide Web, visit
        http://cool.haxx.se/mailman/listinfo/curl-library
or, via email, send a message with subject or body 'help' to
        curl-library-request_at_cool.haxx.se

You can reach the person managing the list at
        curl-library-owner_at_cool.haxx.se

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Curl-library digest..."

Today's Topics:

   1. Re: anonymous SSL (Seshubabu Pasam)

----------------------------------------------------------------------

Message: 1
Date: Mon, 07 Jun 2004 02:47:01 -0700
From: Seshubabu Pasam <pasam_at_seshubabu.com>
Subject: Re: anonymous SSL
To: libcurl development <curl-library_at_cool.haxx.se>
Message-ID: <40C43995.4060902_at_seshubabu.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

You need libcurl compiled with OpenSSL (--with-ssl). Other than that, I
don't think you need anything special. You should be able to specify a
HTTPS URL and retrieve the contents (pretty much like a normal HTTP
request.) Just make sure, that the web/app server does not require a
client certificate.

-S

Serge van den Broek wrote:

>Hi
>
>I am using curl in an application to make HTTP requests, but I would like to make anonymous SSL. I am not a specialist of HTTP (hence the use of curl, which does the job for me !); what are the differences in the options ? Is there any additional library needed (openSSL, etc) ? Shortly, how can I do.
>
>Thanks for your answer
>
>----------------------------------------------------
>Serge van den Broek
>Senior Analyst Programmer
>* svandenbroek_at_isabel.be
>* : +32 (02) 545.17.67 * : +32 (02) 545.17.19
>Isabel SA
>Blvd. de l'Impératrice 13-15
>B - 1000 Bruxelles
>Web : www.isabel.be
>
>DISCLAIMER : Confidential information may be contained in this message and it may be legally privileged. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the official business of Isabel shall be understood as neither given nor endorsed by it. Messages and attachments are swept by a virusscanner. If this message contains password-protected attachments, the files have not been scanned for viruses by the Isabel mail domain. Always scan attachments before opening them.
>
>
>
>
>

-- 
Seshubabu Pasam
Senior Software Engineer
RSA Security Inc.
------------------------------
_______________________________________________
Curl-library mailing list
Curl-library_at_cool.haxx.se
http://cool.haxx.se/mailman/listinfo/curl-library
End of Curl-library Digest, Vol 5, Issue 12
*******************************************
------------------------------
Message: 2
Date: Mon, 7 Jun 2004 12:36:54 +0200 (CEST)
From: Daniel Stenberg <daniel-curl_at_haxx.se>
Subject: building with OpenSSL
To: libcurl development <curl-library_at_cool.haxx.se>
Message-ID: <Pine.LNX.4.58.0406071234240.24893_at_linux3.contactor.se>
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Mon, 7 Jun 2004, Serge van den Broek wrote:
(please use a sensible subject and please trim your quotes)
> Compiling with openSSL, that's what I understood when I looked for
> information on the web.  But it isn't clear for me how to do this.  Does it
> need an extra library (I read something about libeay.lib, for example) ?
If you would tell us a little about what operating system you're using it
might help.
By the "libeay.lib" reference, I guess you're using Microsoft Windows?
If so, how have you tried to build libcurl so far?
Have you read http://curl.haxx.se/docs/install.html ?
-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
------------------------------
Message: 3
Date: Mon, 7 Jun 2004 06:17:17 -0500 (CDT)
From: "Joseph Anto Smith" <antosmith_at_yahoo.com>
Subject: Re: AIX multithreaded issue - CURLE_COULDNT_CONNECT
To: "libcurl development" <curl-library_at_cool.haxx.se>
Message-ID:
	<1848.68.100.68.190.1086607037.fusewebmail-51106_at_www.fusemail.com>
Content-Type: text/plain;charset=iso-8859-1
----- Original Message -----
On Sun, 6 Jun 2004, Joseph Anto Smith Stanley wrote:
> http://article.gmane.org/gmane.comp.web.curl.general/3040
>
> I am having exactly the same problem as described in that post. When
using libcurl with a multi threaded program, fetching http files
*always* returns CURLE_COULDNT_CONNECT.
... and it works when you're not doing it multi-threaded?
Yes, it works fine with non- multi-threaded programs.
> The OS version I am using is AIX 5.2 and libcurl version is 7.12.0
> In fact, I even tried with the multithread.c file present in the
docs/examples folder of curl distribution. Could I get some help here?
The last time I touched an AIX box, it used AIX v3! ;-) (in nostalgic
moments, I show people the little pin I got while being an IBM employee,
saying "/aix/wizard" !)
I can only suggest that you first track down what exact function call(s)
that fails (using strace-style, debugger or printf-style debugging). Then
you check why it fails and if libcurl uses the proper threadsafe version
etc.
I should have included the details earlier... The exact funtion is connect
in connect.c The funny thing is connect returns -1 indicating it failed
but the errno is not set. I suppose this has something to do with threads
and I am stuck in how to proceed further with the debugging.
Thanks again,
Joseph
-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
------------------------------
Message: 4
Date: Mon, 7 Jun 2004 14:31:24 +0200 (CEST)
From: Daniel Stenberg <daniel-curl_at_haxx.se>
Subject: Re: AIX multithreaded issue - CURLE_COULDNT_CONNECT
To: antosmith_at_yahoo.com, libcurl development
	<curl-library_at_cool.haxx.se>
Message-ID: <Pine.LNX.4.58.0406071428301.30294_at_linux3.contactor.se>
Content-Type: TEXT/PLAIN; charset=US-ASCII
On Mon, 7 Jun 2004, Joseph Anto Smith wrote:
> I should have included the details earlier... The exact funtion is connect
> in connect.c The funny thing is connect returns -1 indicating it failed but
> the errno is not set. I suppose this has something to do with threads and I
> am stuck in how to proceed further with the debugging.
This is really out of my league. This is clearly a matter of reading up on AIX
details and figure out what you need to do to build multi-threaded programs
for your operating system.
According to web page[1] I found:
  AIX maintains two kinds of libraries on the system, thread-safe and
  non-thread safe. Multi-threaded libraries on AIX follow a different naming
  convention, Usually the multi-threaded library names are followed with "_r".
  For example, libc.a is single threaded whereas libc_r.a is multi-threaded.
  To make your multi-threaded application run on AIX, you must ensure that you
  do not have a "system library path" in your LIBPATH environment variable
  when you run the application.
[1] =
http://www.slac.stanford.edu/exp/glast/ground/software/extDoc/xerces/1_7_0/doc/faq-build.html#faq-8
-- 
     Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
      Dedicated custom curl help for hire: http://haxx.se/curl.html
------------------------------
Message: 5
Date: Mon, 7 Jun 2004 09:31:00 -0500 (CDT)
From: "Joseph Anto Smith" <antosmith_at_yahoo.com>
Subject: Re: AIX multithreaded issue - CURLE_COULDNT_CONNECT
To: curl-library_at_cool.haxx.se
Message-ID:
	<2117.208.226.118.9.1086618660.fusewebmail-51106_at_www.fusemail.com>
Content-Type: text/plain; charset="iso-8859-1"
Skipped content of type multipart/alternative
------------------------------
Message: 6
Date: Mon, 7 Jun 2004 16:32:17 +0200
From: tor_at_spacetec.no (Tor Arntsen)
Subject: Re: AIX multithreaded issue - CURLE_COULDNT_CONNECT
To: libcurl development <curl-library_at_cool.haxx.se>,
	antosmith_at_yahoo.com
Message-ID: <200406071432.i57EWJXJ024261_at_pallas.spacetec.no>
Content-Type: text/plain; charset=iso-8859-1
On Jun 7, 13:41, Daniel Stenberg wrote:
>On Mon, 7 Jun 2004, Joseph Anto Smith wrote:
>
>> I should have included the details earlier... The exact funtion is connect
>> in connect.c The funny thing is connect returns -1 indicating it failed but
>> the errno is not set. I suppose this has something to do with threads and I
>> am stuck in how to proceed further with the debugging.
>
>This is really out of my league. This is clearly a matter of reading up on AIX
>details and figure out what you need to do to build multi-threaded programs
>for your operating system.
>
>According to web page[1] I found:
[...]
For what it's worth, I'm having no problems using the libcurl easy interface
in multithreaded programs on AIX 5.1 (5102).  However, this is libcurl 7.9.3, 
as that is the version currently available from IBM (I have to use the version 
available to my customers).  My autobuilds are using libcurl from CVS of 
course, but that's only running the built-in tests.
There's nothing in particular to take care of during the link stage, I just
link with -lpthread and that's it. Linker takes care of the rest.  In fact
the makefile looks basically the same as for the same application on Linux.
Somewhen in the future I expect to change our AIX production system to a 
current version of libcurl.  It's strange that any mulithreaded problems
should have been introduced lately though, as we've in fact fixed several
*potential* mulithread problems in the last versions of curl..
-Tor
------------------------------
Message: 7
Date: Mon, 7 Jun 2004 12:16:28 -0700
From: "David Byron" <DByron_at_everdreamcorp.com>
Subject: hang with NTLM auth on both proxy and host during upload
To: <curl-library_at_cool.haxx.se>
Message-ID:
	<133F294F74BE49478D63A5A084D2FC757D83EA_at_EDC-XCHANGE2003.everdream.corp>
	
Content-Type: text/plain;	charset="us-ascii"
curl from current CVS hangs for me in the following case:
./curl https://my_server/my_page -k --verbose -F File=@dummy.txt --user
user:pass --ntlm --proxy http://my_proxy:proxy_port --proxy-user
proxy_user:proxy_pass --proxy-ntlm
like this:
* About to connect() to my_proxy port proxy_port
* Connected to my_proxy (my_proxy) port proxy_port
* Establish HTTP proxy tunnel to my_server
* Proxy auth using NTLM with user 'proxy_user'
* Server auth using NTLM with user 'user'
< HTTP/1.1 407 Proxy Authentication Required ( Access is denied.  )
< Via:1.1 QE-COBPROXY
< Proxy-Authenticate: NTLM
TlRMTVNTUAACAAAAAAAAADAAAAACAgAApyr+N1ZGlP0AAAAAAAAAAAAAAAAwAAAA
< Connection: Keep-Alive
< Proxy-Connection: Keep-Alive
< Pragma: no-cache
< Cache-Control: no-cache
< Content-Type: text/html
< Content-Length: 0
<
* Proxy auth using NTLM with user 'proxy_user'
* Server auth using NTLM with user 'user'
< HTTP/1.1 200 Connection established
< Via: 1.1 QE-COBPROXY
<
* Proxy auth using NTLM with user 'proxy_user'
* Server auth using NTLM with user 'user'
dummy.txt just contains:
foo
but I don't think that matters.
I tried getting a stack trace from gdb with no luck.  I put in a couple
of infof calls, and it seems curl is looping in
Curl_ConnectHTTPProxyTunnel, like this:
987         while((nread<BUFSIZE) && (keepon && !error)) {
(gdb)
988           readfd = rkeepfd;     /* set every lap */
(gdb)
989           interval.tv_sec = 1;  /* timeout each second and check the
timeout */
(gdb)
990           interval.tv_usec = 0;
(gdb)
992           if(data->set.timeout) {
(gdb)
1003          switch (select (tunnelsocket+1, &readfd, NULL, NULL,
&interval)) {
This also hangs with plain old http (changing the url to just http://
and removing the -k), but in a different place -- Transfer() in
transfer.c, in kind of a similar loop.
IE works in both cases.  I can send the trace if it's useful.
Any ideas?  I still haven't come up to speed on the new auth stuff.  If
anyone's got a pointer of where to look in the code that'll help me fix
this myself, great.
Thanks much.
-DB
------------------------------
Message: 8
Date: Mon, 7 Jun 2004 16:26:04 -0500
From: "Rowe David W." <dw.rowe_at_hosp.wisc.edu>
Subject: binary mode on Win32 but LF becomes CRLF
To: <curl-library_at_cool.haxx.se>
Message-ID:
	<C9A9D70A73BC0947AC6071EA9363977203D5D937_at_uwhis-xchng4.uwhis.hosp.wisc.edu>
	
Content-Type: text/plain;	charset="us-ascii"
I have been having a problem with a binary mode transfer on Win32.
I have a cgi program which will retrieve a file with http and write it
to stdout.
I have set the mode of stdout to binary.
All LFs are being converted to CRLF pairs.
I have found that by setting the CURLOPT_WRITEFUNCTION to fwrite with
CURLOPT_WRITEDATA set to stdout the problem goes away. (See code
fragment below.)
I have thought of 3 possible explanations:
1: libcurl is working properly but I don't understand how it is supposed
to work
2: Something went wrong when I built libcurl (i.e. it is just me)
3: This is a bug
Any insight as to why this is happening would be greatly appreciated. It
would be nice to hear whether or not it should work without these
options.
Setting CURLOPT_TRANSFERTEXT and CURLOPT_CRLF has had no effect.
This occurs with 7.11.2 and 7.12.0.
As an aside I needed to add 
	/def:".\libcurl.def" 
to "project settings\link\project options" in VC6 to build 7.12.0.
Code fragment follows:
if ( _setmode( _fileno( stdout ), _O_BINARY ) == -1 )
	ErrorPage("<B>Couldn't set stdout to binary.</B>\n");
else
	{
	CURL *curl;
	CURLcode res;
	res = curl_global_init(CURL_GLOBAL_ALL);
	curl = curl_easy_init();
	if( res != CURLE_OK || curl == NULL )
		ErrorPage("<B>Couldn't initialize cURL.</B>\n");
	else
		{
		curl_easy_setopt(curl, CURLOPT_HEADER, TRUE);
		curl_easy_setopt(curl, CURLOPT_URL, pszURL);
		//without the next two lines LFs become CRLFs
		curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite);
		curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void
*)stdout);
		
		res = curl_easy_perform(curl);
	
		curl_easy_cleanup(curl);
		curl_global_cleanup();
	
		fflush(stdout);
		}	
	}
------------------------------
_______________________________________________
Curl-library mailing list
Curl-library_at_cool.haxx.se
http://cool.haxx.se/mailman/listinfo/curl-library
End of Curl-library Digest, Vol 5, Issue 13
*******************************************
Received on 2004-06-08