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

Fix IPv6 issues. #2357

Closed
wants to merge 1 commit into from
Closed

Fix IPv6 issues. #2357

wants to merge 1 commit into from

Conversation

russjones
Copy link
Contributor

@russjones russjones commented Nov 12, 2018

Purpose

Allow Teleport to set a IPv6 advertise address and allow tsh to connect to IPv6 nodes.

Implementation

  • Encode host:port to allow it to pass userinfo validation.

Related Issues

Fixes #2124

@russjones russjones requested a review from klizhentas November 12, 2018 19:10
@russjones russjones force-pushed the rjones/ipv6 branch 2 times, most recently from fb516de to 3e07393 Compare November 12, 2018 19:41
// passed to url.Parse where the host:port is placed within the userinfo
// part of the URL which only allows alpha numberic plus some punctuation.
// See the following for details: https://github.com/golang/go/issues/23392.
escaped := url.QueryEscape(net.JoinHostPort(tc.Host, strconv.Itoa(tc.HostPort)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to encapsulate this logic in the ssh subsystem call library that already deals with parsing @ instead of sprinkling this over the place. Also is escaping is really necessary? can we detect IPV6 address as is?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue isn't the SSH subsystem, but that we pack an IPv6 address into the userinfo of a URL then try and call url.Parse() on it. The userinfo part of a URL can't contain [ and ], see the following ticket: golang/go#23392.

The other approach we can take is do some refactoring around how we store node/cluster info in a utils.NetAddr, however that seemed a more invasive fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not sure I understand, where do we treat this address as URL and why do we do it?

@russjones
Copy link
Contributor Author

Closing this for now. See #2124 for more details.

@russjones russjones closed this Nov 29, 2018
@russjones russjones deleted the rjones/ipv6 branch January 27, 2021 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants