git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git doesn't honor NO_PROXY environment variable while cloning
@ 2020-09-11 12:15 Ondrej Pohorelsky
  2020-09-11 13:59 ` Jeff King
  0 siblings, 1 reply; 6+ messages in thread
From: Ondrej Pohorelsky @ 2020-09-11 12:15 UTC (permalink / raw)
  To: git

Hi,

we've got a bug[0] reported in Red Hat Bugzilla. It seems like Git
doesn't honor NO_PROXY environment variable while cloning repositories

Reporter has provided these steps to reproduce using Git version 2.18.4:

1. Start a ubi8 container with podman:
```
$ podman run --rm -it registry.access.redhat.com/ubi8/ubi /bin/bash
```
2. Install git in the container - `# yum install -y git`
3. Add "bad" _PROXY environment variables:
```
# export HTTP_PROXY=http://user:pass@bad.proxy
# export HTTPS_PROXY=https://user:pass@bad.proxy
```
4. Add Github as an ignorable proxy domain:
```
# export NO_PROXY=github.com
```
5. Clone a github repo:
```
# mkdir -p /tmp/clone-test
# cd /tmp/clone-test
# git clone https://github.com/sclorg/nodejs-ex.git
# echo $?
```

Actual results:
```
# git clone https://github.com/sclorg/nodejs-ex.git
Cloning into 'nodejs-ex'...
# echo $?
128
```

Expected results:

Git clone succeeds, bypassing the proxy.



However I've found out that this possible issue is present even in
newer versions e.g. 2.28.0.

There is a workaround. You can rewrite proxy to be blank in .gitconfig
for specific websites.
```
[http "https://github.com/"]
        proxy = ""
```

Is this an issue or expected behaviour? And if it is expected
behaviour, then why?

Best regards,
Ondřej Pohořelský


[0]https://bugzilla.redhat.com/show_bug.cgi?id=1875639


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-11 19:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 12:15 Git doesn't honor NO_PROXY environment variable while cloning Ondrej Pohorelsky
2020-09-11 13:59 ` Jeff King
2020-09-11 14:01   ` Jeff King
2020-09-11 15:31   ` Daniel Stenberg
2020-09-11 16:46     ` Jeff King
2020-09-11 19:08       ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).