Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

Composer Curl error 60: SSL certificate problem: unable to get local issuer certificate

  1. Blog
  2. 15 November 2026
  3. 4 min read

Stefan Bogdanescu

Founder & Senior Architect

Composer Curl error 60: SSL certificate problem on Windows Proxies

When running composer install or update behind a corporate proxy, you will often encounter the specific transport exception: curl error 60: SSL certificate problem: unable to get local issuer certificate. This isn't just a generic "connection failed" message; it indicates that cURL has successfully established a TCP connection and received an HTTP response, but the OpenSSL library rejected the peer's certificate because it cannot verify the chain of trust.

On Linux or macOS, this error is rarely seen in production environments because the system bundles a comprehensive ca-bundle.crt (usually at /etc/ssl/certs/ca-certificates.crt) that cURL and PHP automatically use. Windows, however, relies heavily on manual configuration when using third-party binaries like Composer. If your environment lacks the correct Certificate Authority (CA) certificates, or if the proxy intercepts traffic and presents its own certificate without proper trust anchors, Composer will fail to validate the HTTPS response.

The Role of cacert.pem in Composer

The default behavior of Composer is to delegate SSL verification to PHP's OpenSSL extension. When this happens, PHP looks for a file specified by the curl.cainfo directive in your php.ini, or falls back to system defaults. On many Windows installations, these defaults are either empty or point to a directory like C:\Program Files\Common Files\SSL, which may not contain the necessary CA bundles required for modern HTTPS connections.

You cannot simply disable SSL verification using command-line flags like --no-check-certificate. Composer enforces strict security policies and will refuse to ignore certificate errors. Therefore, the solution involves ensuring that the trusted root certificates are available to PHP before it attempts to download packages from Packagist or external repositories like flex.symfony.com.

Configuring the CA Bundle Path

The most common resolution is to explicitly tell PHP where to find the CA bundle. You can obtain this file by downloading cacert.pem from a trusted source, such as the official curl website or the IANA repository. Once downloaded, you must place it in a location accessible to your application and configure php.ini.

Add the following line to your php.ini:

curl.cainfo = "C:\path\to\cacert.pem"

Note that on Windows, quoting the path is essential. If your PHP binary is located at C:\Program Files\PHP\current\php.exe, ensure the full absolute path to the certificate file is used here. After making this change, restart your PHP service or clear any opcode caches if you are using a web server wrapper.

Handling Proxy Interception and Custom Repositories

In scenarios where the error persists despite correct CA configuration, it often points to proxy interference or specific repository misconfigurations. If you are behind a corporate proxy, the proxy server itself terminates the SSL connection to the upstream source (e.g., Packagist) and presents its own certificate to your machine. Your local machine must trust this proxy's certificate for Composer to work correctly.

If standard CA configuration fails, some developers attempt to use the repositories section in composer.json to specify a custom CA file for specific sources. While this approach allows you to inject a different SSL context, it is generally unnecessary unless you are using a private repository with a self-signed certificate.

For example, adding this to composer.json:

{
  "repositories": [{
    "type": "composer",
    "url": "https://flex.symfony.com",
    "options": {
      "ssl": {
        "cafile": "cacert.pem"
      }
    }
  }]
}

will force Composer to use the provided cacert.pem only for that specific repository. However, if the upstream endpoint returns a 404 Not Found (as seen when accessing https://flex.symfony.com/packages.json), the issue is not with the certificate but with the availability of the resource itself. This distinction is critical: an SSL error occurs during the handshake, whereas a 404 indicates the requested file does not exist on the server.

Troubleshooting Steps Summary

If you continue to face curl error 60, verify the following:

  1. Ensure your php.ini has curl.cainfo set to a valid, readable path containing cacert.pem.
  2. Confirm that your proxy settings are correctly applied in your Composer configuration or environment variables.
  3. Check if your proxy requires a specific CA bundle for its own certificate, which may differ from the public root store.

By correctly aligning PHP's OpenSSL configuration with the network realities of your proxy and local machine, you can resolve these SSL handshake issues without compromising security.

Our network