-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for the use of HTTP or SOCKS proxies #309
Comments
If I see this correctly this would be accomplished by subclassing SshClient and overwriting the connect method as well as implementing the ProxyConnectors. |
I was just describing the current state. It is a valid feature request. Though perhaps not "allowing" it, since that is already the case, but providing built-in connectors for HTTP or SOCKS proxies, and wiring them up in SshClient (including some proxy selector abstraction; the single JVM-wide ProxySelector may not cut it for all use cases). Just needs someone who has the time to do this right, including tests. Perhaps the way it was done in JGit can serve as a starting point. |
Ah, yes sure. That's more of a wording issue then. I concur: The code from jGit for proxy handling should somehow make its way into MINA SSHD and all is good. |
Hi here! Any chances to have some sample how to configure BTW, it looks like you don't need We won't mind any contribution back though if we miss something in our Thank you! |
Hello Artem, |
Hm, but this sample does something on the matter, although it is not clear how to leverage that for our
|
Ah, yes as @tomaswolf already pointed out you could write your own code to handle a SOCKS proxy outside of MINA. As for the example you posted I'm not sure what to make out of it. I can see a SOCKS proxy is created and is used to read from a java.net.HttpURLConnection. But I don't see how this proxy is used with MINA. But maybe I missed it the code is a bit, uuhmm....hard on the eyes |
I have had the same struggles and managed to get JGitSshClient working. Here is an minimal example that puts everything together: https://github.com/david0/mina-ssh-over-socks/blob/main/src/main/java/Main.java#L22 I would prefer if MINA would come with SOCKS support build-in, since recent JGIt >=6.0 needs Java 11 minimum. |
Hi @david0 , sorry to ping you here, but I just wanted to ask if you (or anyone else here) know if public key identities has to be added in another way after switching to JGitSshClient? It successfully connects via SOCKS, but during authentication it says that no public keys are available. What is also strange is that it tries to use the DefaultClientIdentityLoader even though I have set a custom one. This all worked OK before I added JGitSshClient. I guess this is related to this comment in JGitSshClient.java
Edit: I replaced |
Huh? If you are talking about the internal client that used inside JGit's binding to Apache MINA sshd, then please note:
|
I was just testing the sample code provided by david0 |
Team, |
Description
I am using MINA SSHD as part of Spring Integration 6.0.1 since it replaced the JSch SSH implementation there.
However, I was using an HTTP proxy to connect with JSch and this seems to be no longer possible with MINA because it supports only SSH jump hosts as a proxy.
So my request would be to implement a more flexible approach to proxies and also allow for the use of HTTP and SOCKS proxies.,
Motivation
This feature is needed to make it possible to use MINA SSHD and the frameworks that depend on it in environments where the server being accessed can only be reached via an HTTP/SOCKS proxy.
Especially In scenarios where MINA SSHD is used for transferring data via SFTP this seems not to be a far-fetched scenario.
Alternatives considered
An alternative would be to install a jump host with internet access. However, in larger organizations this might not always be possible, or take a long time to make it through all the corporate red tape.
Additional context
No response
The text was updated successfully, but these errors were encountered: