Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Algorithm negotiation fail with version 4.11(Not able to use EGit with version 4.11)
Algorithm negotiation fail with version 4.11 [message #1784038] Wed, 21 March 2018 19:51 Go to next message
Dmitriy Mestetskiy is currently offline Dmitriy MestetskiyFriend
Messages: 2
Registered: March 2018
Junior Member
tried everything I can with Egit 4.11 on Eclipse Oxygen to get it working but had no luck. Downgraded to version 4.6 and everything worked.

Checked my JCE and SSH2 and java settings end everything seems fine. anyone have any ideas on why 4.11 doesn't work?

!SUBENTRY 1 org.eclipse.egit.ui 4 0 2018-03-21 13:17:28.395
!MESSAGE ssh://git@host:7999/repo.git: Algorithm negotiation fail
!STACK 0
org.eclipse.jgit.api.errors.TransportException: ssh://git@host:7999/repo.git: Algorithm negotiation fail
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:252)
        at org.eclipse.egit.core.op.FetchOperation.run(FetchOperation.java:132)
        at org.eclipse.egit.ui.internal.fetch.FetchOperationUI.execute(FetchOperationUI.java:108)
        at org.eclipse.egit.ui.internal.fetch.FetchOperationUI$1.performJob(FetchOperationUI.java:134)
        at org.eclipse.egit.ui.internal.jobs.RepositoryJob.run(RepositoryJob.java:57)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://git@host:7999/repo.git: Algorithm negotiation fail
        at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:182)
        at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:140)
        at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:280)
        at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:170)
        at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:137)
        at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:123)
        at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1269)
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:241)
        ... 5 more
Caused by: com.jcraft.jsch.JSchException: Algorithm negotiation fail
        at com.jcraft.jsch.Session.receive_kexinit(Session.java:590)
        at com.jcraft.jsch.Session.connect(Session.java:320)
        at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:136)
        ... 12 more
Re: Algorithm negotiation fail with version 4.11 [message #1784644 is a reply to message #1784038] Sat, 31 March 2018 22:36 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1039
Registered: July 2009
Senior Member
4.11 respects ~/.ssh/config whereas 4.6 does not.
Hence have a look at your ssh configuration
Re: Algorithm negotiation fail with version 4.11 [message #1784691 is a reply to message #1784644] Mon, 02 April 2018 15:49 Go to previous messageGo to next message
Dmitriy Mestetskiy is currently offline Dmitriy MestetskiyFriend
Messages: 2
Registered: March 2018
Junior Member
How can command-line command work but this does not? When I run
git clone ssh://git@host:port/project/branch.git


I see it using config and working fine.
Re: Algorithm negotiation fail with version 4.11 [message #1786753 is a reply to message #1784691] Thu, 10 May 2018 15:26 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1039
Registered: July 2009
Senior Member
By default JGit and EGit use the Java jsch implementation of SSH which is different from openssh used by native git command line.
You can try to use an external SSH implementation by setting the environment variable GIT_SSH to the path of the external
ssh client executable e.g.

$ GIT_SSH=/usr/bin/ssh jgit clone ssh://msohn@git.eclipse.org:29418/jgit/jgit
Cloning into 'jgit'...
remote: Counting objects: 1
remote: Finding sources: 100% (86/86)
Receiving objects: 100% (93745/93745)
Resolving deltas: 100% (41092/41092)

I use the following script "jgit" to start jgit command line from the maven build result:

#!/bin/sh
java -Xmx1G -jar ~/src/git/jgit/org.eclipse.jgit.pgm/target/jgit-cli.jar $*
Re: Algorithm negotiation fail with version 4.11 [message #1786886 is a reply to message #1784691] Mon, 14 May 2018 22:21 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 84
Registered: August 2016
Member
Dmitriy Mestetskiy wrote on Mon, 02 April 2018 15:49
How can command-line command work but this does not?

Eclipse by default uses a Java implementation of an ssh client called jsch. Command line git uses command-line ssh. Evidently one can work where the other may not.

Now,

Caused by: com.jcraft.jsch.JSchException: Algorithm negotiation fail
        at com.jcraft.jsch.Session.receive_kexinit(Session.java:590)

means the client and server could not agree on a cipher for the key exchange. What ciphers does your server offer?

Depending on what your server offers, you may need to enable JCE (Java Cryptography Extensions) to get jsch to use stronger ciphers. See this stack overflow question and its accepted answer for hints.

Previous Topic:fetchResult not working for Jgit (4.9.2.201712150930-r)
Next Topic:EGit could not detect where Git is installed
Goto Forum:
  


Current Time: Tue Nov 13 04:20:03 GMT 2018

Powered by FUDForum. Page generated in 0.02127 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top