Skip to content

Commit

Permalink
Viewer: Fix IllegalArgException w/unknown SSH host
Browse files Browse the repository at this point in the history
... if the SSHPort parameter is unspecified.

(regression introduced by dda0283)
  • Loading branch information
dcommander committed Dec 20, 2024
1 parent f071dba commit 053e754
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions java/com/jcraft/jsch/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public class Session implements Runnable{

String host="127.0.0.1";
String org_host="127.0.0.1";
int port=22;
int defaultPort=22;
int port=defaultPort;

String username=null;
byte[] password=null;
Expand Down Expand Up @@ -2701,9 +2702,11 @@ private void applyConfig() throws JSchException {
host = value;

if(port == -1) {
int port = config.getPort();
if(port != -1)
this.port = port;
int configPort = config.getPort();
if(configPort != -1)
port = configPort;
else
port = defaultPort;
}

checkConfig(config, "kex");
Expand Down

0 comments on commit 053e754

Please sign in to comment.