cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: default location for ca-bundle.crt on windows

From: Yuping He <yuping.he_at_gmx.de>
Date: Thu, 24 Oct 2002 09:18:55 +0200 (MEST)

As user (not developer) I want to only know, for what shall the ca-bundle be
applied and how can I use ca-bundle?

Yu Ping

> -----Original Message-----
> From: Daniel Stenberg [mailto:daniel_at_haxx.se]
> Sent: Wednesday, October 23, 2002 10:26 AM
>
> > This is not at all a bad idea. But AFAIK, windows users are not known
> > to use environment variables very widely either.
>
> True. However, it's nice to provide that option, for those few windows
> users who do like to use environment variables. There are more who like
> environment variables than there are using a .curlrc file or $HOME...
>
> > Is it possibly in windows to figure out where the curl binary is
> located
> > when that is run? If so, we could check that directory first for the
> > presence of a file using the standard ca cert bundle name.
>
> I was kind of hoping that would be a "standard" thing in C, until I
> realized that argv[0] is just what the user typed when he ran curl.exe;
> not necessarily a full path.
>
> So, here's a tiny program that will find a given filename by looking in
> these folders, in order:
> 1. directory the executable is in
> 2. current working directory
> 3. Windows System Directory (e.g. C:\windows\system32)
> 4. Windows Directory (e.g. C:\windows)
> 5. %PATH%
>
>
> #include <windows.h>
>
> int main(int argc, char *argv[])
> {
> DWORD buflen;
> char *ptr = NULL; //pointer to the file-name part of the path
> char *retval = (char *) malloc(sizeof (TCHAR) * (MAX_PATH + 1));
> retval[0] = '\0';
> buflen = SearchPath(NULL, "curl-ca-bundle.crt", NULL, MAX_PATH+1,
> retval, &ptr);
> if (buflen > 0)
> printf("Path: %s\n", retval);
>
> free(retval);
> return 0;
> }
>
>
> Can this code be adjusted for proper use in curl and added, possibly
> along
> with the code for looking up that environment variable?
>
> --Kevin
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: Influence the future
> of Java(TM) technology. Join the Java Community
> Process(SM) (JCP(SM)) program now.
> http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0002en
>

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!
-------------------------------------------------------
This sf.net email is sponsored by: Influence the future 
of Java(TM) technology. Join the Java Community 
Process(SM) (JCP(SM)) program now. 
http://ad.doubleclick.net/clk;4729346;7592162;s?http://www.sun.com/javavote
Received on 2002-10-24