0
wget https://skype.com -O - > /dev/null

isn't good. I just want to create a short bash script to check that an HTTPS cert is valid or no. i think wget doesn't connects if the cert is invalid. i just need a parameter? to wget to only work on HTTPS! are there any?

2
  • 1
    What do you actually want? Check if a certificate is valid, or force wget to connect only if a certificate is valid?
    – Lekensteyn
    Jun 16, 2011 at 8:35
  • What do you see as a valid cert?
    – echox
    Jun 16, 2011 at 8:36

2 Answers 2

2

For your purpose, just call wget. It will retrieve the certificate and refuse to connect if the certificate is invalid.

Obviously, if you pass an https:// URL, wget will connect using HTTPS.

3
0

To answer your question in the title: Pass --https-only to force wget to follow https links exclusively. This can be useful for sites that silently downgrade connections to insecure ones.

1
  • The wget manual says about --https-only: "When in recursive mode, only HTTPS links are followed." This sounds like this argument is ignored when retrieving a single file. May 8, 2020 at 3:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .