cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl problem with -k option on win32

From: Jochen Roderburg <Roderburg_at_uni-koeln.de>
Date: Sat, 15 Jan 2005 09:36:18 +0100

Zitat von Daniel Stenberg <daniel-curl_at_haxx.se>:

> On Fri, 14 Jan 2005, Jochen Roderburg wrote:
>
> > The internal variable for the name seems to stay uninitialised in this
> case.
>
> Can you elaborate? What internal variable and where? I'm not saying you're
> wrong, I'm just not seeing what you describe...
>

data->set.ssl.CAfile in lib/url.c

it is initialised there like

354:#ifdef CURL_CA_BUNDLE
355- /* This is our prefered CA cert bundle since install time */
356: data->set.ssl.CAfile = (char *)CURL_CA_BUNDLE;
357-#endif

and I assume this is not done in the Windows version.

I found this variable by following what happens to the value of the --cacert
call parameter in the program.

With this theory I was also now able to simulate the error under Linux.
I replaced the above line with data->set.ssl.CAfile = -1 and now I get also a
chrash under Linux with -k.
And here I can produce a more usable backtrace with gdb ;-)

#0 0xb7d885eb in strlen () from /lib/libc.so.6
#1 0xb7d88295 in strdup () from /lib/libc.so.6
#2 0xb7fd208b in Curl_clone_ssl_config () from /usr/local/lib/libcurl.so.3
#3 0xb7fd2ac1 in Curl_connect () from /usr/local/lib/libcurl.so.3
#4 0xb7fde644 in Curl_connect_host () from /usr/local/lib/libcurl.so.3
#5 0xb7fde8ec in Curl_perform () from /usr/local/lib/libcurl.so.3
#6 0xb7fdf091 in curl_easy_perform () from /usr/local/lib/libcurl.so.3

And indeed, in the function Curl_clone_ssl_config the variable CAfile is used in
a strdup call:

3687: if(source->CAfile) {
3688: dest->CAfile = strdup(source->CAfile);
3689: if(!dest->CAfile)
3690- return FALSE;
3691- }

Of course there are some unproven parts in this theory, because I cannot see
what the CAFile really contains in the Windows case. That would now need some
real debugging there.

Regards, J.Roderburg
Received on 2005-01-15