wget without --no-check-certificate

12

1

when a try use a wget in a https site, I need add

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

how I can use a more short argument?
for don't use this very long string.

juanpablo

Posted 2012-11-21T13:31:45.547

Reputation: 5 216

Answers

9

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.

0xAether

Posted 2012-11-21T13:31:45.547

Reputation: 478

@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. – Wyatt8740 – 2016-02-24T15:32:38.120

1INCORRECT: As of 2017 (and earlier?) add check_certificate=off to ~/.wgetrc – clearlight – 2018-01-09T19:44:10.793

1Your 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 – 2012-11-21T21:29:44.073

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 – 2012-11-21T21:48:08.580

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 – 2012-11-21T21:57:41.307

25

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

MarkHu

Posted 2012-11-21T13:31:45.547

Reputation: 426

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. – None – 2017-06-19T16:07:14.587

1This even works with Windows ports of wget. – Synetech – 2018-05-04T02:27:26.223