Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wget ssl alert handshake failure

Tags:

https

ssl

wget

I am trying to download files from an https site and keep getting the following error:

OpenSSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure Unable to establish SSL connection. 

From reading blogs online I gather I have to provide the server cert and the client cert. I have found steps on how to download the server cert but not the client cert. Does anyone have a complete set of steps to use wget with SSL? I also tried the --no-check-certificate option but that did not work.

wget version: wget-1.13.4 openssl version: OpenSSL 1.0.1f 6 Jan 2014 

trying to download all lecture resources from a course's webpage on coursera.org. So, the URL would look something like this: https://class.coursera.org/matrix-002/lecture

Accessing this webpage online requires form authentication, not sure if that is causing the failure.

like image 216
sotn Avatar asked Jun 13 '15 10:06

sotn


People also ask

What does SSL handshake failed mean?

A TLS/SSL handshake failure occurs when a client and server cannot establish communication using the TLS/SSL protocol. When this error occurs in Apigee Edge, the client application receives an HTTP status 503 with the message Service Unavailable.

Is wget encrypted?

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 Transport Security). If Wget is compiled without SSL support, none of these options are available.


2 Answers

It works from here with same OpenSSL version, but a newer version of wget (1.15). Looking at the Changelog there is the following significant change regarding your problem:

1.14: Add support for TLS Server Name Indication.

Note that this site does not require SNI. But www.coursera.org requires it. And if you would call wget with -v --debug (as I've explicitly recommended in my comment!) you will see:

$ wget https://class.coursera.org ... HTTP request sent, awaiting response...   HTTP/1.1 302 Found ... Location: https://www.coursera.org/ [following] ... Connecting to www.coursera.org (www.coursera.org)|54.230.46.78|:443... connected. OpenSSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure Unable to establish SSL connection. 

So the error actually happens with www.coursera.org and the reason is missing support for SNI. You need to upgrade your version of wget.

like image 171
Steffen Ullrich Avatar answered Sep 22 '22 03:09

Steffen Ullrich


You probably have an old version of wget. I suggest installing wget using Chocolatey, the package manager for Windows. This should give you a more recent version (if not the latest).

Run this command after having installed Chocolatey (as Administrator):

choco install wget 
like image 34
Pheelbert Avatar answered Sep 21 '22 03:09

Pheelbert