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

Share:
19,234

Related videos on Youtube

Brett
Author by

Brett

Updated on September 18, 2022

Comments

  • Brett
    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 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.

  • sheina meilhada
    sheina meilhada over 7 years
    Hi, I tried with above suggested solution and many more options with other blogs, but I am still facing same issue. Kindly suggest
  • sheina meilhada
    sheina meilhada over 7 years
    thank 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
    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
    sheina meilhada over 7 years
    Thank you for update, I will try and update in case if I found any solution.