Closed devvthedev closed 1 month ago
Given that the stack trace shows that this NPE is from org.apache.sshd.git.transport.GitSshdSession
: yes, this is a question for the Apache MINA sshd maintainers.
That said, JGit has its own integration with Apache MINA sshd in bundle org.eclipse.jgit.ssh.apache
, which is tailored to the needs of JGit, works with the latest JGit versions, can do connections through SOCKS or HTTP CONNECT proxies, and has support for PKCS#11 hardware security modules (like YubiKey PIV). If you add org.eclipse.jgit.ssh.apache.agent
you even have integration with SSH agents on Windows, Linux, and OS X.
Thanks @tomaswolf will see what they say 👍
Hello,
I'm using the following JGit and Apache MINA dependencies in my project:
I've created a default
org.apache.sshd.client.SshClient
with:SshClient sshClient = SshClient.setUpDefaultClient();
and then set an instance of the GitSshdSessionFactory on JGits SshSessionFactory:
SshSessionFactory.setInstance(new GitSshdSessionFactory(sshClient));
By default the sshClient is reading the SSH keys I have stored in the
~/.ssh
folder where theconfig
file has the following configuration:I am using a passphrase-less private SSH key.
The question I have is around JGits Git push command call when talking back to the remote repository.
For example,
git clone git@github.com:devvthedev/my-project.git
Made some changes to the repo
Opened the repo using JGit with
Git.open(...)
and get aGit
object backStaged the changes I made and committed them:
I get the following error:
If I provide a CredentialsProvider with the
git
user and no password:It works!
So my question is - why is a CredentialsProvider required given I have configured a
SshSessionFactory
instance?Or is this a question that should be asked to the
Apache MINA SSHD Project
maintainers?Thank you