Adding a self-signed cert to the trusted certs within cURL in Windows?
I have created a self-signed cert from the instructions on this page, have installed it and it appears to all be working correctly, but now I need cURL
to trust it.
Since the later versions of cURL don't include a trusted list within a .pem
file, I downloaded the .pem file here and then input this line in php.ini
:
curl.cainfo = "C:\xampp\php\cacert.pem"
Now all I need to know is how do I get cURL
to trust my self-signed cert? I don't need any browsers to trust it, just cURL.
Solution 1:
Seems all I had to do was open up the cacert.pem
file and add the contents of the server.crt
file to it.
For those reading, server.crt
was the file that got created when I created the self-signed cert and which I copied over to: C:\xampp\apache\conf\ssl.crt\server.crt