-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Closed
Labels
Description
I did this
I have set up %HOMEDRIVE%%HOMEPATH%\_netrc
and %APPDATA%\_netrc
for the server I want to connect, but it seems that neither is consulted:
curl.exe -nv _url_requiring_authentication_
* Couldn't find host _host_ in the _netrc file; using defaults
...
< HTTP/1.1 401 Unauthorized
I expected the following
As %HOME% is not commonly set on Windows, I expected curl to consult also %APPDATA%. It is done for _curlrc, but not for _netrc. It would be good to resolve _netrc the same way. Currently it looks like no path is considered due to %HOME% not being set.
Line 59 in 3538026
char *home = homedir(); /* portable homedir finder */ Line 80 in 697b1f9
char *home = curl_getenv("HOME"); /* portable environment reader */ Line 63 in f762fec
char *homedir(void)
The change would not impact non-Windows platforms and would not affect current behavior when %HOME% is set, since it's the first considered in homedir() function.
curl/libcurl version
> curl.exe -V
curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: [unreleased]
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL
operating system
Microsoft Windows [Version 10.0.18362.175]