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

Make the proxy jump resolver a bit more flexible. #477

Closed
wants to merge 2 commits into from
Closed

Make the proxy jump resolver a bit more flexible. #477

wants to merge 2 commits into from

Conversation

nightman68
Copy link

fix #318.

do {
entry = resolveHost(userInfo, host, port, context, null);
jumps.add(entry);
} while((host = entry.getProxyJump()) != null);
Copy link
Member

Choose a reason for hiding this comment

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

The list may also need to be reversed. Both your configurations should give a connection

client -> jump3 -> jump2 -> jump1 -> target

but I think they give

client -> jump1 -> jump2 -> jump3 -> target

?

Also: what if host at line 690 is again a chain (multiple hosts separated by commas)? As in the config

Host jump1
  Hostname                    jump1.corp
  Port                        22
  User                        nightman
  ProxyJump                   jump2,jump3
  LogLevel                    QUIET

Host jump2
  HostName                    jump2.dmz.corp
  Port                        22
  User                        nightman
  #ProxyJump                   jump3
  LogLevel                    QUIET

Host jump3
  HostName                    jump3.dmz.corp
  Port                        22
  User                        nightman
  LogLevel                    QUIET

Host host*.dmz.corp
  ProxyJump                   jump1

@nightman68
Copy link
Author

  1. I fixed the proxy order for "inline" definition - my mistake.
  2. The code is now supporting your example configuration above.

@tomaswolf
Copy link
Member

Thank you; looks much better. Not sure about the precedence of the lists but we can tackle that issue when it arises.

Could you add tests for this?

@nightman68
Copy link
Author

Sorry, I do not have the time at the moment getting familiar with your test suite etc.

@tomaswolf
Copy link
Member

Fixed differently via PR #512 (including tests).

@tomaswolf tomaswolf closed this Jun 2, 2024
@nightman68
Copy link
Author

In what release the changes will be included? I can't find this information...

@tomaswolf
Copy link
Member

See https://github.com/apache/mina-sshd/blob/master/docs/changes/2.13.0.md. It does mention the issue. (Use 2.13.1. Publishing to Maven Central of 2.13.0 omitted the source bundles.)

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.

Support for more than one jump host
2 participants