Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

manish049's avatar

Getting cURL error 60: SSL certificate problem

I am using php 8.2, valet and trying to test homepage. But I am getting GuzzleHttp\Exception\RequestException: cURL error 60: SSL certificate problem: unable to get local issuer certificate

0 likes
4 replies
LaryAI's avatar
Level 58

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:

  1. Download the latest CA certificate bundle. You can get it from the official cURL website: https://curl.se/docs/caextract.html

  2. Save the cacert.pem file to a directory on your machine that you can reference.

  3. Update your php.ini file to reference the new CA certificate bundle. You can find your php.ini file by running php --ini in your terminal. Once you've located the file, open it and set the curl.cainfo and openssl.cafile directives to the path of the cacert.pem file 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.

  1. 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
  1. 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.

kiwi0134's avatar

Please show your code.

What exactly are you trying to achieve?

Please or to participate in this conversation.