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

Improve IPv6 handling for host names #740

Closed
pjbgf opened this issue Apr 12, 2023 · 1 comment
Closed

Improve IPv6 handling for host names #740

pjbgf opened this issue Apr 12, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@pjbgf
Copy link
Member

pjbgf commented Apr 12, 2023

IPv6 host names are not being properly handled, which results in unhelpful error messages depending on the format used. Examples:

  • git@[::ffff:8c52:7903]:go-git/go-git.git results in dial tcp: address [:22: missing ']' in address
  • git@::ffff:8c52:7903:go-git/go-git.git results in dial tcp: lookup git@: no such host

This issue could be potentially tackled in two ways:

  • (short-term) Adding error message highlighting that IPv6 is not supported for host names.
  • (long-term) Add full support for IPv6 as host names.
@pjbgf pjbgf added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Apr 12, 2023
@pjbgf pjbgf changed the title Add support for IPv6 host names Improve IPv6 handling for host names Apr 12, 2023
@crazybolillo
Copy link

I was able to reproduce this with the following test (in remote_test.go):

func (s *RemoteSuite) TestFetchIPV6Endpoint(c *C) {
	r := NewRemote(nil, &config.RemoteConfig{Name: "foo", URLs: []string{"http://[2001:db8::]"}})
	err := r.Fetch(&FetchOptions{RemoteName: "foo"})
	c.Assert(err, IsNil)
}

The error is returned by res, err := s.client.Do(req.WithContext(ctx)) on plumbing/transport/http/common.go:55:

As far as my understanding goes the http.session object must be setup correctly to use tcp6 (in the case of https at least), still looking into it.

@pjbgf pjbgf closed this as completed in a105da8 Aug 5, 2023
pjbgf added a commit that referenced this issue Aug 5, 2023
plumbing: transport, handle IPv6 while parsing endpoint. Fixes #740
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants