Adding a self-signed cert to the trusted certs within cURL in Windows?
19,234
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
Related videos on Youtube
Author by
Brett
Updated on September 18, 2022Comments
-
Brett over 1 year
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 inphp.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. -
sheina meilhada over 7 yearsHi, I tried with above suggested solution and many more options with other blogs, but I am still facing same issue. Kindly suggest
-
sheina meilhada over 7 yearsthank you for quick response. Actually the issue is, I am using composer to download package and that repo is protected with SSL. So the issue occurred while downloading package with composer.
-
Brett over 7 years@HirenSoni In that case it shouldn't have anything to do with using a self-signed SSL cert on your local machine? Sounds like you need the protocol you are using to connect to the repo to trust the SSL cert they are using; probably a bit outside the scope of this question and better to create a new one?
-
sheina meilhada over 7 yearsThank you for update, I will try and update in case if I found any solution.