Wget unable to download anything from https sources.

homebrew

Using wget to download files from an https source is causing a host is down error.

$ wget https://www.google.co.uk/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png
--2018-07-16 20:56:17--  https://www.google.co.uk/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png
Resolving www.google.co.uk (www.google.co.uk)... 216.58.198.163
Connecting to www.google.co.uk (www.google.co.uk)|216.58.198.163|:443... failed: Host is down.
Retrying.

--2018-07-16 20:56:18--  (try: 2)  https://www.google.co.uk/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png
Connecting to www.google.co.uk (www.google.co.uk)|216.58.198.163|:443... failed: Host is down.
Retrying.

When downloading files via http wget works as expected. I'm also able to download the file via curl. However, I prefer wget. As I'm using wget -i flag to download about 50 different files from a url.txt file.

I've tried downloading the source file via desktop Chrome, and again there's no issue.

wget is version GNU Wget 1.19.5 built on darwin17.5.0. and installed via $ brew --version Homebrew 1.6.17 Homebrew/homebrew-core (git revision f0ff; last commit 2018-07-15). I'd previously run into an issue with pip and openssl a while back. Which I've still been unable to fix. So wonder if this might becausing the issue?

Best Answer

It would appear that your issues with openssl are indeed the cause. From the wget manpage:

HTTPS (SSL/TLS) Options

To support encrypted HTTP (HTTPS) downloads, Wget must be compiled with an external SSL library. The current default is GnuTLS. In addition, Wget also supports HSTS (HTTP Strict TransportSecurity). If Wget is compiled without SSL support, none of these options are available.