From fc9b1fbf6b61d0730abfa0855229b133100ef555 Mon Sep 17 00:00:00 2001 From: Christian Halstrick Date: Fri, 14 Mar 2014 16:21:46 +0100 Subject: [PATCH] Ensure that ssh authentication is retried only in JGit JGit wants to control retries during ssh authentication. But JSch by default already retries 6 times. Hence disable retries in JSch. Without this the credentials provider isn't reset if e.g. wrong credentials are specified. Bug: 430210 Change-Id: I6fa726a14a84b06411e7010608c7a1e2bfb8bfe8 --- .../org/eclipse/jgit/transport/JschConfigSessionFactory.java | 3 +++ 1 file changed, 3 insertions(+) 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 d70148861e..36d429a021 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java @@ -148,6 +148,9 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory { FS fs, String user, final String pass, String host, int port, final OpenSshConfig.Host hc) throws JSchException { final Session session = createSession(hc, user, host, port, fs); + // We retry already in getSession() method. JSch must not retry + // on its own. + session.setConfig("MaxAuthTries", "1"); //$NON-NLS-1$ //$NON-NLS-2$ if (pass != null) session.setPassword(pass); final String strictHostKeyCheckingPolicy = hc -- 2.39.5