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

Deveasey's avatar

Curl error 60: WSL2 Laravel Sail

Ok, i have tried most solutions i could find and I can not get this error to go away. Error: cURL error 60: SSL certificate problem: self-signed certificate

Environment: Windows 10 PRO PHP 8.2 Laravel 10 guzzle 7.2 Sail 1.8 docker v4 16.2 ubuntu 22.04

I'm trying to hit a API route that works with postman, but not in the application. I have downloaded the latest cacert.pem and put it in the docker\8.2 directory

my php.ini

[PHP]
post_max_size = 100M
upload_max_filesize = 100M
variables_order = EGPCS

[curl]
curl.cainfo = "\wsl.localhost\Ubuntu\root\sites\project1\docker.2\cacert.pem"

[opcache]

opcache.enable_cli=1

This really seems like there should be a simple cmd or a set of instructions for docker to run.

0 likes
3 replies
LaryAI's avatar
Level 58

The issue is with the self-signed SSL certificate. One solution is to add the certificate to the trusted certificates list. Here are the steps to do that:

  1. Copy the certificate file to the trusted certificates directory. In this case, the certificate file is cacert.pem and the trusted certificates directory is /usr/local/share/ca-certificates/.
sudo cp /path/to/cacert.pem /usr/local/share/ca-certificates/
  1. Update the trusted certificates list.
sudo update-ca-certificates
  1. Restart the web server.
sudo service apache2 restart

If you're using Nginx, replace apache2 with nginx in the above command.

Alternatively, you can disable SSL verification in Guzzle by setting the verify option to false. However, this is not recommended as it can leave your application vulnerable to man-in-the-middle attacks.

$client = new \GuzzleHttp\Client([
    'verify' => false
]);
Deveasey's avatar

so the set of rest api endpoints require https. i have got the cacerts for the rest api and tried updating my cacerts i have updated windows and ubuntu certs as far as i can tell.

Please or to participate in this conversation.