I'm using Goutte to get a page on a web server using an SSL certificate. Whenever I try to get this page the the following exception is thrown:
Uncaught exception 'Guzzle\\Http\\Exception\\CurlException' with message
'[curl] 35: error:1407742E:SSL
routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
[url] https://somesite.com
I have been looking online for this type of error. It seems that this error happens when there is a handshake failure. The server seems to support TLSv1 and the client uses SSL23.
I'm not sure if this assessment is correct nor do I know how to correct it.
This is the code I'm currently using:
<?php
use Goutte\Client;
$client = new Client();
$guzzle = $client->getClient();
$guzzle->setConfig(
array(
'curl.CURLOPT_SSL_VERIFYHOST' => false,
'curl.CURLOPT_SSL_VERIFYPEER' => false,
)
);
$client->setClient($guzzle);
$crawler = $client->request('GET', 'https://somesite.com'); // IT FAILS HERE
UPDATE:
NOTE: I started getting a few weeks ago a similar error, so I thought I would update the question and answer as they are related.
I got a similar error:
[curl] 35: Unknown SSL protocol error in connection to website.com:443