Source:
protected void openConnection(TaskListener listener) throws IOException, InterruptedException { listener.getLogger().println(Messages.SSHLauncher_OpeningSSHConnection(getTimestamp(), host + ":" + port)); connection.setTCPNoDelay(true); for (int i = 0; i <= maxNumRetries; i++) { try { connection.connect(); break; } catch (IOException ioexception) { listener.getLogger().println(ioexception.getCause().getMessage()); String ioExceptionMessageCause = ""; if (ioexception.getCause() != null) { ioExceptionMessageCause = ioexception.getCause().getMessage(); } if (!ioExceptionMessageCause.equals("Connection refused")) { break; } if (maxNumRetries - i > 0) { listener.getLogger().println("SSH Auth failed with IOException: \"" + ioExceptionMessageCause + "\", retrying in " + retryWaitTime + " seconds. There are " + (maxNumRetries - i) + " more retries left."); } else { listener.getLogger().println("SSH Auth failed with IOException: \"" + ioExceptionMessageCause + "\"."); throw ioexception; } } Thread.sleep(TimeUnit.SECONDS.toMillis(retryWaitTime)); } StandardUsernameCredentials credentials = getCredentials(); if (credentials == null) { throw new AbortException("Cannot find SSH User credentials with id: " + credentialsId); } if (SSHAuthenticator.newInstance(connection, credentials).authenticate(listener) && connection.isAuthenticationComplete()) { listener.getLogger().println(Messages.SSHLauncher_AuthenticationSuccessful(getTimestamp())); } else { listener.getLogger().println(Messages.SSHLauncher_AuthenticationFailed(getTimestamp())); throw new AbortException(Messages.SSHLauncher_AuthenticationFailedException()); } }

Target:
protected void openConnection(TaskListener listener) throws IOException, InterruptedException { listener.getLogger().println(Messages.SSHLauncher_OpeningSSHConnection(getTimestamp(), host + ":" + port)); connection.setTCPNoDelay(true); for (int i = 0; i <= maxNumRetries; i++) { try { connection.connect(); break; } catch (IOException ioexception) { listener.getLogger().println(ioexception.getCause().getMessage()); String ioExceptionMessageCause = ""; if (ioexception.getCause() != null) { ioExceptionMessageCause = ioexception.getCause().getMessage(); } if (!ioExceptionMessageCause.equals("Connection refused")) { break; } if (maxNumRetries - i > 0) { listener.getLogger().println("SSH Connection failed with IOException: \"" + ioExceptionMessageCause + "\", retrying in " + retryWaitTime + " seconds. There are " + (maxNumRetries - i) + " more retries left."); } else { listener.getLogger().println("SSH Connection failed with IOException: \"" + ioExceptionMessageCause + "\"."); throw ioexception; } } Thread.sleep(TimeUnit.SECONDS.toMillis(retryWaitTime)); } StandardUsernameCredentials credentials = getCredentials(); if (credentials == null) { throw new AbortException("Cannot find SSH User credentials with id: " + credentialsId); } if (SSHAuthenticator.newInstance(connection, credentials).authenticate(listener) && connection.isAuthenticationComplete()) { listener.getLogger().println(Messages.SSHLauncher_AuthenticationSuccessful(getTimestamp())); } else { listener.getLogger().println(Messages.SSHLauncher_AuthenticationFailed(getTimestamp())); throw new AbortException(Messages.SSHLauncher_AuthenticationFailedException()); } }