JGit used to rely on JSch as its transport provider, but changed because JSch does not accept certain keys, including some OpenSSH ones.
If you are using a passphrase-encrypted key with JGit, the recommended approach with JSch used to be to override a configuration callback, as shown in this blog article.
The alternative is to set a shared session factory and this also what the Apache MINA team recommends with a pointer to the cost of creating sessions on demand.
However, my issue with this is that it sets a specific provider for the whole system scope. Consequently, I would like to implement TransportConfigCallback
. Ultimately, this requires to adapt SshSessionFactory
to MINA's session initialization code and produce a RemoteSession
.
Has anyone done this or seen any boilerplate code?