【发布时间】:2022-02-14 19:51:30
【问题描述】:
JGit 过去依赖 JSch 作为其传输提供程序,但由于 JSch 不接受某些密钥(包括一些 OpenSSH 密钥)而发生了变化。
如果您在 JGit 中使用密码短语加密密钥,则推荐的 JSch 方法曾经是 to override a configuration callback, as shown in this blog article。
替代方案是set a shared session factory 和这个also what the Apache MINA team recommends with a pointer to the cost of creating sessions on demand。
但是,我的问题是它为整个系统范围设置了一个特定的提供程序。因此,我想实现TransportConfigCallback。最终,这需要使SshSessionFactory 适应MINA 的会话初始化代码并生成RemoteSession。
有没有人这样做或看过任何样板代码?
【问题讨论】:
标签: configuration openssh jgit apache-mina