JGit: Support fallback to local SSH private key

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Type: Improvement
    • Resolution: Won't Do
    • Priority: Minor
    • Component/s: git-plugin
    • Environment:
      Jenkins 2.289.3, Git 4.8.1, Git Client 3.9.0

      It seems that the JGit client does not fallback to the default local private key stored in ~/.ssh/...

      After switching from CLI to JGit client I see the following errors

      Caused by: org.eclipse.jgit.errors.TransportException: ssh://git@......git: remote hung up unexpectedly
      	at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:313)
      	at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:153)
      	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:142)
      	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:94)
      	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1309)
      	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:213)
      	... 11 more
      Caused by: java.lang.IllegalStateException: Cannot open session, connection is not authenticated.
      	at com.trilead.ssh2.Connection.openSession(Connection.java:1080)
      	at org.jenkinsci.plugins.gitclient.trilead.TrileadSession$ProcessImpl.<init>(TrileadSession.java:46)
      	at org.jenkinsci.plugins.gitclient.trilead.TrileadSession.exec(TrileadSession.java:36)
      	at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:296)
      	... 16 more
      

      This is especially an issue since Jenkins decides with the https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/jenkins/plugins/git/GitToolChooser.java automatically which client to use.

            Assignee:
            Unassigned
            Reporter:
            Konrad Windszus
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: