Hey Friends,
In this blog, I am going to share how I solved SSL Certificate problem on my local environment of php when I was doing a woocommerce integration.
I am talking about Woocommerce only, however, the concept is same when you want to connect with any api which is using https
PROBLEM:
- I have a website based on Wordpress using Woocommerce using https
- I need to populate the products from the website on my custom application and hence I was using local php environment.
- I was using WAMP for the development purposes.
- I was following Woocommerce Rest API documentation to do the development
- I got the error "unable to get local issuer certificate"
SOLUTION:
- Download cacert.pem from the official curl website
- Open php ssl folder and place the cert there. In my case it was:
C:\wamp64\bin\php\php7.4.9\extras\ssl
- If you use different version of php development server, make sure you place the file in the correct folder. Check php version with command
php --version
- Open php.ini file and look for openssl.cafile and add the path of your certificate
- Restart Apache/WAMP and if you are using VSCode terminal, simply restart VSCode
- Yay! your problem should be solved.
Happy Coding!!!