summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2018-10-21 19:44:34 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2018-11-17 07:28:06 -0800
commit6c14d273faa89ab1657e818315b68f3bd672ff87 (patch)
treedf5bd5c09cac7fd5a02fc59d14199c08d3c20250 /org.eclipse.jgit.pgm
parent7aaeb6489f9819227fa8ebe122a849b6029242b7 (diff)
downloadjgit-6c14d273faa89ab1657e818315b68f3bd672ff87.tar.gz
jgit-6c14d273faa89ab1657e818315b68f3bd672ff87.zip
Apache MINA sshd client: proxy support
This is not about the ssh config ProxyCommand but about programmatic support for HTTP and SOCKS5 proxies. Eclipse allows the user to specify such proxies, and JSch at least contains code to connect through proxies. So our Apache MINA sshd client also should be able to do this. Add interfaces and provide two implementations for HTTP and SOCKS5 proxies. Adapt the core code to be able to deal with proxy connections at all. The built-in client-side support for this in sshd 2.0.0 is woefully inadequate. Tested manually by running proxies and then fetching various real- world repositories via these proxies from different servers. Proxies tested: ssh -D (SOCKS, anonymous), tinyproxy (HTTP, anonymous), and 3proxy (SOCKS & HTTP, username-password authentication). The GSS-API authentication is untested since I have no Kerberos setup. Bug: 520927 Change-Id: I1a5c34687d439b3ef8373c5d58e24004f93e63ae Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java
index 1ca35a24e6..c4b4018b8f 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java
@@ -70,6 +70,7 @@ import org.eclipse.jgit.pgm.internal.SshDriver;
import org.eclipse.jgit.pgm.opt.CmdLineParser;
import org.eclipse.jgit.revwalk.RevWalk;
import org.eclipse.jgit.transport.SshSessionFactory;
+import org.eclipse.jgit.transport.sshd.DefaultProxyDataFactory;
import org.eclipse.jgit.transport.sshd.JGitKeyCache;
import org.eclipse.jgit.transport.sshd.SshdSessionFactory;
import org.eclipse.jgit.util.io.ThrowingPrintWriter;
@@ -249,7 +250,7 @@ public abstract class TextBuiltin {
switch (sshDriver) {
case APACHE: {
SshdSessionFactory factory = new SshdSessionFactory(
- new JGitKeyCache());
+ new JGitKeyCache(), new DefaultProxyDataFactory());
Runtime.getRuntime()
.addShutdownHook(new Thread(() -> factory.close()));
SshSessionFactory.setInstance(factory);