I tried to download an image through wget but I got an error: Unable to establish SSL connection.
wget https://www.website.com/image.jpg
--2015-02-26 01:30:17-- https://www.website.com/image.jpg
Resolving www.website.com (www.website.com)... xx.xxx.xx.xx
Connecting to www.website.com (www.website.com)|xx.xxx.xx.xx|:443... connected.
Unable to establish SSL connection.
My test case:
Another variable is that the www.website.com uses TLS 1.0. I don't have an idea how this affects wget. But if I wget an image from TLS 1.2 websites I don't get any ssl connection errors from both test cases.
Is Ubuntu 14.04 or wget 1.15 not compatible with TLS 1.0 websites? Do I need to install/download any library/software to enable this connection?
you must be using old version of wget i had same issue. i was using wget 1.12.so to solve this issue there are 2 way:
Update wget
or use curl
curl -LO 'https://example.com/filename.tar.gz'
If you trust the host, either add the valid certificate, specify --no-check-certificate
or add:
check_certificate = off
into your ~/.wgetrc
.
In some rare cases, your system time could be out-of-sync therefore invalidating the certificates.
Although this is almost certainly not the OPs issue, you can also get Unable to establish SSL connection
from wget
if you're behind a proxy and don't have HTTP_PROXY
and HTTPS_PROXY
environment variables set correctly. Make sure to set HTTP_PROXY
and HTTPS_PROXY
to point to your proxy.
This is a common situation if you work for a large corporation.
Source: Stackoverflow.com