Magento Component Manager: SSL certificate problem: unable to get local issuer certificate

(Another user posted a link to solve the problem, but then deleted his answer somehow.)

The problem occured on my local machine using XAMPP. It's not a Magento problem, it's a cURL problem: cURL does not trust my own, self-signed SSL certificate.

Here's how to fix it: https://serverfault.com/questions/633644/adding-a-self-signed-cert-to-the-trusted-certs-within-curl-in-windows

If it still does not work, make sure the cacert.pem file is mentioned in php.ini: https://laracasts.com/discuss/channels/laravel/how-to-solve-curl-error-60-ssl-certificate-in-laravel-5-while-facebook-authentication/replies/104758


It is not the wisest idea, but for a local environment can work even without generating self signed certificates:

In <magento2_root>/setup/src/Magento/Setup/Model/MarketplaceManager.php

change this: protected $urlPrefix = 'https://'; into protected $urlPrefix = 'http://';

This is really a modification of a core file, so avoid this method if you can solve the problem with a certificate.

Update: In 2.1.x the file to edit is <magento2_root>/setup/src/Magento/Setup/Model/PackagesAuth.php

Tags:

Magento2