24

When I try to use wget on an HTTPS site, I need to add:

 wget --no-check-certificate https://...

This is rather long, so does a shortcut exist?

2 Answers 2

23

From what I can see there's no shorter version of the --no-check-certificate option.

So you could always make an alias to it. alias wgetncc='wget --no-check-certificate' (Change 'wgetncc' to whatever you please.)

Type that into the command line and after that, every time you run wgetncc it will be a shortcut to wget --no-check-certificate

If you want this to be an alias every time you login, you will have to place this in an alias file or something equivalent. It depends on the shell you are using.

5
  • 1
    Your accepted answer is naturally what the OP was looking for, but I'm interested in knowing why one would simply assume he was talking about Wget on Linux and not Windows, and thus recommend alias?
    – Karan
    Nov 21, 2012 at 21:29
  • 1
    I didn't know for sure. But my guess was formulated from two different factors: 1) Most of the time wget isn't used on Windows. 2) OP's other questions are about GNU/Linux. So that is why I assumed he was talking about GNU/Linux.
    – 0xAether
    Nov 21, 2012 at 21:48
  • Hmm, I guess that's fine although I wish people would specify their operating environment and other relevant details instead of making people guess and possibly wasting their time.
    – Karan
    Nov 21, 2012 at 21:57
  • @Karan just going to point out that no one ever assumes wget even exists on windows. It is typically used in bourne shell or other unix-y shells. I compiled wget for windows, but I almost always run it within MSYS bash or a cygwin shell.
    – Wyatt Ward
    Feb 24, 2016 at 15:32
  • 1
    INCORRECT: As of 2017 (and earlier?) add check_certificate=off to ~/.wgetrc
    – clearlight
    Jan 9, 2018 at 19:44
44

Try this: (assumes *nix)

echo "check_certificate = off" >> ~/.wgetrc

Then ever after, wget will act like you specified the --no-check-certificate switch. More info at https://www.gnu.org/software/wget/manual/wget.html#Wgetrc-Syntax or https://www.gnu.org/software/wget/manual/wget.html#Wgetrc-Location

2
  • 2
    A thing to note: don't add comments in the same line as the directive itself. check_certificate=off # --no-check-certificate will result in syntax error as the config won't load properly. Other than that, omitting spaces around the assignment sign is OK.
    – user373230
    Jun 19, 2017 at 16:07
  • 4
    This even works with Windows ports of wget. 👍
    – Synetech
    May 4, 2018 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.