“Algorithm negotiation fail” error in Eclipse when

2019-08-09 02:41发布

问题:

I have Eclipse Juno, a Synology Server DS213+ with a Git Server. I'm trying to checkout a project from my Git Server to my workspace and when I use EGit in Eclipse I have this error:

org.eclipse.jgit.api.errors.TransportException: ssh://[route]/volume1/Git/project.git: Algorithm negotiation fail
    at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:223)
    at org.eclipse.jgit.api.LsRemoteCommand.call(LsRemoteCommand.java:159)
    at org.eclipse.egit.core.op.ListRemoteOperation.run(ListRemoteOperation.java:99)
    at org.eclipse.egit.ui.internal.clone.SourceBranchPage$8.run(SourceBranchPage.java:324)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://[route]/volume1/Git/project.git: Algorithm negotiation fail
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:159)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136)
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
    at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
    at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:202)
    ... 4 more
Caused by: com.jcraft.jsch.JSchException: Algorithm negotiation fail
    at com.jcraft.jsch.Session.receive_kexinit(Session.java:583)
    at com.jcraft.jsch.Session.connect(Session.java:320)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
    ... 8 more

[route] is correct and works fine in other git softwares

回答1:

I found this blog with the solution:

http://blog.millard.org/2014/11/repair-synology-dsm51-for-use-as-linux.html

Using WinSCP http://winscp.net/eng/download.php I modified sshd_config and restart ssh in the Control Panel of Synology.



回答2:

Egit in Eclipse seems to throw this error when it does not support any of the chipers supported the the ssh server. In my case, the SSH server was set to only accept a handful of strong chipers. I noticed errors similar to the following on the server's ssh logs:

fatal: Unable to negotiate with xx.xx.xx.xx port 12345: no matching cipher found. Their offer: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc

The reason for the error on the client was because the default Java install did not support any of the strong chipers. Since we were already using the webupd8 team ppa to install our Java packages, the solution was to simply install the unlimited-jce-policy package.

apt install oracle-java8-unlimited-jce-policy

Restart Eclipse and you're all set.