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 10:43:03 +0100

Zitat von Gisle Vanem <giva_at_bgnett.no>:

> "Jochen Roderburg" wrote:
>
> > 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.
>
> Because Windows (and DOS) cannot use the hardcoded hack that's
> done on Unix (where CURL_CA_BUNDLE = /usr/share/bla-bla set
> by configure).
>
> Instead use env-var CURL_CA_BUNDLE. Comment from .\src\main.c:
>
> On WIN32 (non-cygwin), we can't set the path to curl-ca-bundle.crt
> at compile time. So we look here for the file in two ways:
> 1: look at the environment variable CURL_CA_BUNDLE for a path
> 2: if #1 isn't found, use the windows API function SearchPath()
> to find it along the app's path (includes app's dir and CWD)
>
> ----
>
> Or put something like this in your $HOME/_curlrc file.
> --cacert = c:\curl\lib\ca-bundle.crt
>
> If you don't have %HOME set, curl will look in %APPDATA, then
> %USERPROFILE%\Application Data

Yes, I know all that, and it all works fine in the case that the cert bundle
file is really needed and used.

And my experiments showed that is also works with the -k option when it finds
such a file. But it doesn't do #2 above (the SearchPath thing) when you give
the -k option, and you need one of the remaining method to explicitly set the
location of the file. This is my found workaround to avoid the -k crash ;-)

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