Community
Participate
Working Groups
We have to configure the session-properties of the JSch-instance via .setConfig(String,String). For example, one of the properties is telling JSch to instantiate a special class on certain connections (dependent on the target host). As far as I can see, the best place to have an extension-point for that, would be in EclipseSshSessionFactory.configure(OpenSshConfig.Host hc, Session session) after or instead of the default configuration there. At the moment I set my own SshSessionFactory, which is a subclass of JschConfigSessionFactory and implements the configure-method. The two reasons for subclassung that instead of EclipseSshSessionFactory is, that the latter is placed in egit.ui (egit.core would be a better place) and that it is not public. This solution is not ideal - but at least looks like working. If you could provide an extension-point like the one mentioned above, I'd happily change my code for that. In case you do, please consider moving EclipseSshSessionFactory from egit.ui- to egit.core-plugin also (I am using that in a 'headless' plugin). Thx & greetings Kurt
I think it's a good idea to move this code to the egit.core bundle as it has no UI dependencies. There are some more classes in the same package which would better be located in egit.core. I'll look into this. What kind of configuration do you want to apply on the session factory for what reason ?
In the configure-method for the factory we are setting some properties, like MaxAuthTries and the like on the session. But also our own UserInfo and a class (the name) for gssapi-authentication, which JSch instantiates and uses then. So instead of setting our own ssh-session-factory, it probably would be more 'compatible' if there would be an extension-point as mentioned before.
(In reply to Matthias Sohn from comment #1) > I think it's a good idea to move this code to the egit.core bundle as it has > no UI dependencies. There are some more classes in the same package which > would better be located in egit.core. I'll look into this. EclipseSshSessionFactory.configure() is using UserInfoPrompter which is a UI dependency. Maybe we can adapt this to JGit's CredentialsProvider.getDefault() which in EGit is set to EGitCredentialsProvider which comes from org.eclipse.egit.ui
New Gerrit change created: https://git.eclipse.org/r/69087
Gerrit change https://git.eclipse.org/r/69087 was merged to [master]. Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=ae26a5b3cf07a41ead52f27791d5c1f82325cfa5