0

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
  • 781
  • 3
  • 13
  • 29
  • have you tried as mentioned in the man pages `--proxy-user=user` `--proxy-password=password` – matzeri Feb 01 '20 at 06:24
  • hi @matzeri, thanks for your help. Since this was not getting attention in SO, I posted also in another community (that actually found it out of topic - sob! - but put me in the right direction). You can find the solution to my problem [here](https://askubuntu.com/questions/1206863/proxy-authentication-using-wget-on-cygwin). Basically instead of editing the global configuration file `wgetrc`, I should have created a new `.wgetrc` in my home directory. – Nemesi Feb 03 '20 at 10:13
  • @Nemesi You can write this as an answer. – Bodo Feb 03 '20 at 11:17
  • Thanks for the suggestion @Bodo. You are right, I';ll do that. – Nemesi Feb 03 '20 at 14:22

1 Answers1

1

This problem was solved thanks to the suggestion of a User of the community AskUbuntu.

Basically, instead of editing the global configuration file wgetrc, I should have created a new .wgetrc with my proxy configuration in my Cygwin home directory.

In summary:

Step 1 - Create a .wgetrc file;

nano ~/.wgetrc

Step 2 - record in this file the proxy info:

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
Nemesi
  • 781
  • 3
  • 13
  • 29