"Composer SSL certificate problem: unable to get local issuer certificate (curl error 60)"

Updated: Feb 18, 2025

"Composer SSL certificate problem: unable to get local issuer certificate (curl error 60)"

The error message "Composer SSL certificate problem: unable to get local issuer certificate (curl error 60)" indicates that Composer, the popular PHP dependency manager, is unable to verify the SSL certificate of a repository it is trying to access. This can occur for a few reasons, and here are some steps you can take to troubleshoot and resolve the issue.

  1. Check your system's SSL certificate store:

The first step is to check if the SSL certificate for the repository is installed on your system. You can do this by running the following command in your terminal or command prompt:

openssl s_client -connect repository-url:443 -showcerts

Replace "repository-url" with the URL of the repository that is giving you the SSL error. If the certificate is not installed on your system, you will see an error message. If the certificate is installed, you can verify that it is valid by checking the issuer and expiration date.

  1. Add the repository's SSL certificate to your system's trust store:

If the SSL certificate is not installed on your system, you can add it manually. To do this, you will need to obtain the certificate file (usually in PEM format) from the repository or the certificate authority that issued it. Once you have the certificate file, you can add it to your system's trust store using the following command:

sudo cp certificate-file.pem /usr/local/share/ca-certificates/
sudo update-ca-certificates

Replace "certificate-file.pem" with the name of the certificate file you downloaded.

  1. Configure Composer to trust the repository's SSL certificate:

Another option is to configure Composer to trust the repository's SSL certificate without adding it to your system's trust store. To do this, you can create a file called "composer.json" in your project directory with the following content:

{
    "minimum-stability": "dev",
    "repositories": [
        {
            "type": "vcs",
            "url": "https://repository-url",
            "ssl-verify-peer": false
        }
    ]
}

Replace "repository-url" with the URL of the repository that is giving you the SSL error. This will tell Composer to not verify the SSL certificate for this repository. However, this is not recommended for production environments, as it can leave your system vulnerable to man-in-the-middle attacks.

  1. Update Composer:

Make sure that you have the latest version of Composer installed. You can check your version by running the following command:

composer --version

If you are not using the latest version, you can update it by running the following command:

sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
  1. Check your firewall or proxy settings:

If none of the above steps work, check if your firewall or proxy settings are blocking the SSL connection. You may need to configure your firewall or proxy to allow the SSL connection to the repository.

  1. Contact the repository owner:

If none of the above steps work, you may need to contact the owner of the repository and let them know about the SSL certificate problem. They may be able to provide you with a valid SSL certificate or help you troubleshoot the issue.