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

cmd/go: credentials from .netrc are not applied to URLs containing an explicit port #37130

Open
dhowden opened this issue Feb 7, 2020 · 1 comment
Assignees
Milestone

Comments

@dhowden
Copy link

@dhowden dhowden commented Feb 7, 2020

What version of Go are you using (go version)?

$ go version
go version go1.13.7 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

Run a go mod proxy on a custom port (i.e. https://myproxy.mydomain.com:4433).

Setup .netrc:

machine myproxy.mydomain.com
  login username
  password secret

Note: the .netrc spec defines the machine property as the machine name: https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html.

Set GOPROXY env variable:

export GOPROXY="myproxy.mydomain.com:4433"

What did you expect to see?

Auth credentials passed in proxy requests.

What did you see instead?

No auth credentials passed in proxy requests.

Work around

Note: it is possible to get around this by adding the port to the machine name property in the .netrc file.

machine myproxy.mydomain.com:4433
  login username
  password secret

CC: @bcmills

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Feb 7, 2020

Change https://golang.org/cl/218418 mentions this issue: cmd/go/internal/auth: fix .netrc lookup for URLs with specified port

@bcmills bcmills added the NeedsFix label Feb 7, 2020
@bcmills bcmills added this to the Go1.15 milestone Feb 7, 2020
@bcmills bcmills added the GoCommand label Feb 7, 2020
@bcmills bcmills changed the title Matching .netrc machine name fails if URL has specified port cmd/go: credentials from .netrc are not applied to URLs containing an explicit port Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.