Source:
protected void openConnection(final TaskListener listener, final SlaveComputer computer) throws IOException, InterruptedException { PrintStream logger = listener.getLogger(); logger.println(Messages.SSHLauncher_OpeningSSHConnection(getTimestamp(), host + ":" + port)); connection.setTCPNoDelay(!disableTcpNoDelay); int maxNumRetries = this.maxNumRetries == null || this.maxNumRetries < 0 ? 0 : this.maxNumRetries; for (int i = 0; i <= maxNumRetries; i++) { try { int launchTimeoutMillis = (int)getLaunchTimeoutMillis(); connection.connect(new ServerHostKeyVerifier() { @Override public boolean verifyServerHostKey(String hostname, int port, String serverHostKeyAlgorithm, byte[] serverHostKey) throws Exception { final HostKey key = new HostKey(serverHostKeyAlgorithm, serverHostKey); return getSshHostKeyVerificationStrategyDefaulted().verify(computer, key, listener); } }, launchTimeoutMillis, 0 , launchTimeoutMillis); break; } catch (IOException ioexception) { @CheckForNull String message = ""; Throwable cause = ioexception.getCause(); if (cause != null) { message = cause.getMessage(); logger.println(message); } if (cause == null || !isRecoverable(message)) { throw ioexception; } if (maxNumRetries - i > 0) { logger.println("SSH Connection failed with IOException: \"" + message + "\", retrying in " + retryWaitTime + " seconds. There are " + (maxNumRetries - i) + " more retries left."); } else { logger.println("SSH Connection failed with IOException: \"" + message + "\"."); 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()) { logger.println(Messages.SSHLauncher_AuthenticationSuccessful(getTimestamp())); } else { logger.println(Messages.SSHLauncher_AuthenticationFailed(getTimestamp())); throw new AbortException(Messages.SSHLauncher_AuthenticationFailedException()); } }

Target:
protected void openConnection(final TaskListener listener, final SlaveComputer computer) throws IOException, InterruptedException { PrintStream logger = listener.getLogger(); logger.println(Messages.SSHLauncher_OpeningSSHConnection(getTimestamp(), host + ":" + port)); connection.setTCPNoDelay(getTcpNoDelay()); int maxNumRetries = this.maxNumRetries == null || this.maxNumRetries < 0 ? 0 : this.maxNumRetries; for (int i = 0; i <= maxNumRetries; i++) { try { int launchTimeoutMillis = (int)getLaunchTimeoutMillis(); connection.connect(new ServerHostKeyVerifier() { @Override public boolean verifyServerHostKey(String hostname, int port, String serverHostKeyAlgorithm, byte[] serverHostKey) throws Exception { final HostKey key = new HostKey(serverHostKeyAlgorithm, serverHostKey); return getSshHostKeyVerificationStrategyDefaulted().verify(computer, key, listener); } }, launchTimeoutMillis, 0 , launchTimeoutMillis); break; } catch (IOException ioexception) { @CheckForNull String message = ""; Throwable cause = ioexception.getCause(); if (cause != null) { message = cause.getMessage(); logger.println(message); } if (cause == null || !isRecoverable(message)) { throw ioexception; } if (maxNumRetries - i > 0) { logger.println("SSH Connection failed with IOException: \"" + message + "\", retrying in " + retryWaitTime + " seconds. There are " + (maxNumRetries - i) + " more retries left."); } else { logger.println("SSH Connection failed with IOException: \"" + message + "\"."); 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()) { logger.println(Messages.SSHLauncher_AuthenticationSuccessful(getTimestamp())); } else { logger.println(Messages.SSHLauncher_AuthenticationFailed(getTimestamp())); throw new AbortException(Messages.SSHLauncher_AuthenticationFailedException()); } }