Setting CURL Parameters for fabpot/goutte Client Setting CURL Parameters for fabpot/goutte Client curl curl

Setting CURL Parameters for fabpot/goutte Client


To set curl options by the way, it looks like guzzle recognizes the key "curl" as a config setting, which takes in an array of curl-related config values. So the equivalent of what you were initially trying to achieve would look like the following

$client = new \Goutte\Client();$guzzleClient = new \GuzzleHttp\Client(array(    'curl' => array(        CURLOPT_TIMEOUT => 60,    ),));$client->setClient($guzzleClient);$crawler = $client->request('GET', $my_url);

Not sure how well this is supported since it isn't indicated anywhere in the guzzle docs (and doing it this way makes it look like its dependent on CURL, which I think is not the intention of guzzle. Hence the general timeout config entry).


What I ended up doing is the following:

$this->client->setClient(new GuzzleClient(['verify' => false]));

The 'verify' => false when initiating the GuzzleClient makes it not verify the certificates.


In the recent version of Goutte (v4.0) only this works.

Use this HttpClient interface:

use Symfony\Component\HttpClient\HttpClient;

Goutte instance.

$client = new \Goutte\Client(HttpClient::create(['verify_peer' => false]));