Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

configured http.proxy works for git but not for jgit

Tags:

git

jgit

Lets show the --global .gitconfig first, as git and as jgit sees it!!! from a DOS window as well as from a Cgywin window

E:\> git config --list --global
http.auth.preference=Basic
user.name=Josef Stadelmann
[email protected]
http.proxy=http://C770817:[email protected]:8080

E:\>

Now lets look from a Cygwin Window with JGit

$ jgit config --list --global
http.auth.preference=Basic
[email protected]
user.name=Josef Stadelmann
http.proxy=http://C770817:[email protected]:8080

WE CAN SEE THE SAME CONFIGURATION THEN WHY DOES

C770817@C036357 ~
$ jgit ls-remote https://github.com/stadelma/HelloWorld.git
fatal: Connection time out: github.com
fatal: https://github.com/stadelma/HelloWorld.git: cannot open git-upload-pack

timeout BUT

C770817@C036357 ~
$ git ls-remote http://github.com/stadelma/HelloWorld.git
35f375cb64208b64ed499c2a47727dfcd8813dea        HEAD
35f375cb64208b64ed499c2a47727dfcd8813dea        refs/heads/master

C770817@C036357 ~
$

works properly reading the same .gitconfig at

/cygdrive/e/mingw/home/.gitconfig

????

Any advise welcome - OR - shall I just start debugging jgit ?

Josef

like image 634
Sepp as user2439935 Avatar asked Jul 18 '13 16:07

Sepp as user2439935


1 Answers

You can try and see if an environment variable would work better, with java option like:

-Dhttp.proxyHost=myproxyhosturl
-Dhttp.proxyPort=8080
-Dhttp.nonProxyHosts=”localhost|mybambooserverurl”

As in this question:

  • Dhttp.proxyHost – proxy IP address
  • Dhttp.proxyPort – proxy port
  • Dhttp.proxyUser – user name if HTTP-proxy authentication required;
  • Dhttp.proxyPassword – user password if HTTP-proxy authentication required.
like image 185
VonC Avatar answered Nov 04 '22 04:11

VonC