The error you're encountering indicates that cURL is unable to verify the SSL certificate of the server it's trying to communicate with. This is a common issue when you're working in a local development environment and the SSL certificates are not properly set up or recognized by cURL.
Here's a solution to resolve the cURL error 60 in your local development environment:
-
Download the latest CA certificate bundle. You can get it from the official cURL website: https://curl.se/docs/caextract.html
-
Save the
cacert.pemfile to a directory on your machine that you can reference. -
Update your
php.inifile to reference the new CA certificate bundle. You can find yourphp.inifile by runningphp --iniin your terminal. Once you've located the file, open it and set thecurl.cainfoandopenssl.cafiledirectives to the path of thecacert.pemfile you just downloaded. For example:
[curl]
curl.cainfo = "/path/to/downloaded/cacert.pem"
[openssl]
openssl.cafile = "/path/to/downloaded/cacert.pem"
Make sure to replace /path/to/downloaded/cacert.pem with the actual path to the cacert.pem file on your system.
- After making these changes, you'll need to restart your web server for the changes to take effect. If you're using Laravel Valet, you can restart it using the command:
valet restart
- Try running your Guzzle request again. The SSL certificate problem should now be resolved.
If you're still encountering issues, you can temporarily disable SSL certificate verification in Guzzle as a last resort (not recommended for production):
$client = new \GuzzleHttp\Client(['verify' => false]);
$response = $client->request('GET', 'https://your-secure-url.com');
Remember, disabling SSL certificate verification is insecure and should only be used as a temporary workaround during development. Always ensure that SSL certificate verification is enabled in production environments to prevent man-in-the-middle attacks.