while (!session.isConnected()) {
try {
retries++;
session.connect(tms);
} catch (JSchException e) {
session.disconnect();
session = null;
// Make sure our known_hosts is not outdated
knownHosts(getJSch(hc, fs), fs);
if (isAuthenticationCanceled(e)) {