Goutte icon indicating copy to clipboard operation
Goutte copied to clipboard

SSL error causes Goutte to crash uncaught

Open jlillyreed opened this issue 8 years ago • 1 comments

When scraping a site, if it has a link to a page with https protocol, but SSL is not enabled on the site, Goutte crashes and Symfony returns a 500 error, rather than gracefully handling the error.

The error that is returned is:

cURL error 35: Server aborted the SSL handshake (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) 500 Internal Server Error - ConnectException

This error occurs and crashes Symfony, regardless if a try { } catch (GuzzleHttp\Exception\ConnectException $ex) {} is put around the request

jlillyreed avatar Apr 08 '16 15:04 jlillyreed

$client = new Client(); $guzzleClient = new \GuzzleHttp\Client(array( 'verify' => false )); $client->setClient($guzzleClient); $res = $client->request('GET', $url);

taiho007008 avatar Sep 25 '18 09:09 taiho007008