Skip to content

ProxyJump: no default port supplied if there is no HostConfigEntry for the jump host #727

@tomaswolf

Description

@tomaswolf

Originally posted by @chylek-qr in #351

It's not resolved in 2.15.0. I redacted the username and domain names, but .ssh/config looks like this:

Host example.proxy
        User username
        Hostname 192.168.123.123
        ProxyJump username@example.com

The proxy jump gets parsed as ssh://username@example.com, and then https://github.com/apache/mina-sshd/blob/master/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java#L723 gets -1 as the port, passes it into the jump HostConfigEntry, and it fails validation.

java.lang.IllegalArgumentException: Invalid port: -1
	at org.apache.sshd.common.util.ValidateUtils.createFormattedException(ValidateUtils.java:234)
	at org.apache.sshd.common.util.ValidateUtils.throwIllegalArgumentException(ValidateUtils.java:200)
	at org.apache.sshd.common.util.ValidateUtils.checkTrue(ValidateUtils.java:183)
	at org.apache.sshd.client.SshClient.doConnect(SshClient.java:562)
	at org.apache.sshd.client.SshClient.doConnect(SshClient.java:574)
	at org.apache.sshd.client.SshClient.connect(SshClient.java:552)
	at org.apache.sshd.client.session.ClientSessionCreator.connect(ClientSessionCreator.java:199)
	at org.apache.sshd.client.session.ClientSessionCreator.connect(ClientSessionCreator.java:188)

Metadata

Metadata

Assignees

Labels

bugAn issue describing a bug in the code

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions