From adabb08390d59a8913ff9785958f44b91d1ab236 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 30 Jul 2019 10:25:59 +0200 Subject: [PATCH] NetworkUpload. use ipAddress to start jSch session Fixes #9097 --- .../src/cc/arduino/packages/ssh/SSHConfigFileSetup.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arduino-core/src/cc/arduino/packages/ssh/SSHConfigFileSetup.java b/arduino-core/src/cc/arduino/packages/ssh/SSHConfigFileSetup.java index 2f2e53cff44..5d4cb66cf7e 100644 --- a/arduino-core/src/cc/arduino/packages/ssh/SSHConfigFileSetup.java +++ b/arduino-core/src/cc/arduino/packages/ssh/SSHConfigFileSetup.java @@ -46,7 +46,6 @@ public SSHConfigFileSetup(SSHClientSetupChainRing nextChainRing) { @Override public Session setup(BoardPort port, JSch jSch) throws JSchException, IOException { String ipAddress = port.getAddress(); - String hostname = port.getBoardName().contains(".local") ? port.getBoardName() : port.getBoardName() + ".local"; File sshFolder = new File(System.getProperty("user.home"), ".ssh"); File sshConfig = new File(sshFolder, "config"); @@ -62,7 +61,7 @@ public Session setup(BoardPort port, JSch jSch) throws JSchException, IOExceptio jSch.setConfigRepository(new OpenSSHConfigWrapper(configRepository, ipAddress)); - return jSch.getSession(hostname); + return jSch.getSession(ipAddress); } public static class OpenSSHConfigWrapper implements ConfigRepository {