Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netrc not respected if login token is not present #9148

Closed
centromere opened this issue Jul 13, 2022 · 3 comments
Closed

netrc not respected if login token is not present #9148

centromere opened this issue Jul 13, 2022 · 3 comments

Comments

@centromere
Copy link

I did this

➜  ~ cat netrc
machine foo.cachix.org password foo
➜  ~ /usr/local/opt/curl/bin/curl -v --netrc-file netrc https://foo.cachix.org/nix-cache-info
...
> GET /nix-cache-info HTTP/2
> Host: foo.cachix.org
> user-agent: curl/7.83.1
> accept: */*
>
...
< HTTP/2 401
...

I expected the following

> GET /nix-cache-info HTTP/2
> Host: foo.cachix.org
> authorization: Basic IiI6Zm9v
> user-agent: curl/7.83.1
> accept: */*
>
...
< HTTP/2 200
...

It works when

➜  ~ cat netrc
machine foo.cachix.org login "" password foo
➜  ~ /usr/local/opt/curl/bin/curl -v --netrc-file netrc https://foo.cachix.org/nix-cache-info
...
> GET /nix-cache-info HTTP/2
> Host: foo.cachix.org
> authorization: Basic IiI6Zm9v
> user-agent: curl/7.83.1
> accept: */*
>
...

curl/libcurl version

➜  ~ /usr/local/opt/curl/bin/curl --version
curl 7.83.1 (x86_64-apple-darwin21.3.0) libcurl/7.83.1 (SecureTransport) OpenSSL/1.1.1o zlib/1.2.11 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.2 libssh2/1.10.0 nghttp2/1.47.0 librtmp/2.3 OpenLDAP/2.6.2
Release-Date: 2022-05-11
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL TLS-SRP UnixSockets zstd

operating system

OSX 12.4, curl installed with homebrew.

@bagder
Copy link
Member

bagder commented Jul 13, 2022

see #9066

@bagder
Copy link
Member

bagder commented Jul 13, 2022

Duplicate of #8653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants