-4

This question was also posted on SO.

My institute recently installed a new proxy server for our network. I am trying to configure my Cygwin environment to be able to run wget and download data from a remote repository.

Browsing the internet I have found two different solutions to my problem, but no one of them seem to work in my case.

The first one I tried was to follow these instructions, so in Cygwin:

cd /cygdrive/c/cygwin64/etc/
nano wgetrc

at the end of the file, I added:

use_proxy = on
http_proxy=http://username:password@my.proxy.ip:my.port/
https_proxy=https://username:password@my.proxy.ip:my.port/
ftp_proxy=http://username:password@my.proxy.ip:my.port/

(of course, using my user and password)

The second approach was what was suggested by this SO post, so in my Cygwin environment:

export http_proxy=http://username:password@my.proxy.ip:my.port/
export https_proxy=https://username:password@my.proxy.ip:my.port/
export ftp_proxy=http://username:password@my.proxy.ip:my.port/

in both cases, if I try to test my wget, I get the following:

$ wget http://www.google.com
--2020-01-30 12:12:22--  http://www.google.com/
Resolving my.proxy.ip (my.proxy.ip)... 10.1XX.XXX.XX
Connecting to my.proxy.ip (my.proxy.ip)|10.1XX.XXX.XX|:8XXX... connected.
Proxy request sent, awaiting response... 407 Proxy Authentication Required
2020-01-30 12:12:22 ERROR 407: Proxy Authentication Required.

It looks like if my user and password are not ok, but I actually checked them on my browsers and my credentials work just fine.

Any idea on what this could be due to?

Nemesi
  • 95

1 Answers1

2

First of all you shouldn't edit the global configuration/startup file wgetrc. I would reinstall wget using the cygwin installer to get a fresh one. Instead of editing the global configuration you should provide your own by creating .wgetrc in your home folder. I.e.

nano ~/.wgetrc

(notice the . at the start of the filename, it's important)

Next I think the contents of that file should be:

use_proxy=on
http_proxy=http://my.proxy.ip:my.port
https_proxy=https://my.proxy.ip:my.port
ftp_proxy=http://my.proxy.ip:my.port
proxy_user=username
proxy_password=password

Notice that I separated the proxy user and password from the proxy URLs. Not that it should really make a difference, but you never know. I also removed the trailing / as that can make a difference, depending on how the proxy is configured.

According to the documentation:

These startup file variables allow you to override the proxy settings specified by the environment.

Meaning that the configuration you put in your .wgetrc will override any environment variables that you export.

Misantorp
  • 648