Search code examples
wgetunauthorized

wget - 401 Unauthorized, but URL is working fine


Below is the command I'm trying.

wget -o /tmp/response.txt <url> --ca-certificate=< my-ca-cert> --certificate=< my-cert> --private-key=< my-private-key> --no-check-certificate

Result:

HTTP request sent, awaiting response... 401 Unauthorized

Authorization failed.

Note: I've checked for the ceritificates, private keys, etc and those are good. Also, when I'm trying to hit the URL directly from browser, it is working fine.

Please suggest.


Solution

  • After almost an year, I got the solution for my issue.

    Since the URL was working in a browser, I went ahead and inspected through WireShark and found out that, this URL was internally connecting to a SiteMinder for Authentication.

    I had to allow the linux box (used for wget command) in the SiteMinder and it worked like a charm!