Configured http.proxy works for git, but not for jgit

Allows you to first display -global.gitconfig as git and as jgit sees !!! from the DOS window, as well as from the Cgywin window

E:\> git config --list --global http.auth.preference=Basic user.name=Josef Stadelmann user.email=josef.stadelmann@axa-winterthur.ch http.proxy=http://C770817: MyPassword@bcproxyserver.ch.winterthur.com :8080 E:\> 

Now let's see from the Cygwin window with JGit

 $ jgit config --list --global http.auth.preference=Basic user.email=josef.stadelmann@axa-winterthur.ch user.name=Josef Stadelmann http.proxy=http://C770817: MyPassword@bcproxyserver.ch.winterthur.com :8080 

WE CAN SEE SUCH CONFIGURATION THEN WHY WHY

 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 ~ $ 

working correctly by reading the same .gitconfig in

 /cygdrive/e/mingw/home/.gitconfig 

????

Any advice welcome - OR - am I just starting to debug jgit?

Joseph

+4
source share
1 answer

You can try and see if the environment variable works better, with the java parameter, for example:

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

As in this question :

  • Dhttp.proxyHost - proxy server IP address
  • Dhttp.proxyPort - proxy port
  • Dhttp.proxyUser - username if HTTP proxy authentication is required;
  • Dhttp.proxyPassword - user password if HTTP proxy authentication is required.
+2
source

Source: https://habr.com/ru/post/1492132/


All Articles