diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java index 36d429a02..65e9d4dc5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java @@ -117,6 +117,9 @@ public synchronized RemoteSession getSession(URIish uri, } catch (JSchException e) { session.disconnect(); session = null; + // Make sure our known_hosts is not outdated + knownHosts(getJSch(hc, fs), fs); + // if authentication failed maybe credentials changed at the // remote end therefore reset credentials and retry if (credentialsProvider != null && e.getCause() == null