Composer update fails while updating from packagist

Composer update fails while updating from packagist

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

Stefan Bogdanescu

Founder & Senior Architect

Composer Update Fails While Updating from Packagist: Resolving OpenSSL Certificate Verification Errors

When executing composer update or composer install, you might encounter an immediate SSL failure that halts the dependency resolution process. The specific error message indicates that the packages.json file could not be downloaded because OpenSSL failed to verify the server certificate. In environments utilizing XAMPP, particularly with legacy PHP versions like 5.6.3 on Ubuntu 14.04, this issue often stems from a mismatch between the OpenSSL library bundled with the distribution and the certificates required for modern HTTPS connections.

The core of the problem lies in the TransportException reported by Composer: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed. This error signifies that the local SSL context cannot validate the identity of packagist.org. Composer attempts to download the version metadata and the repository index, but if the cryptographic handshake fails, it falls back to a local cache. While this allows the command to proceed partially, the installed package versions will inevitably be outdated, compromising your application's security and functionality.

Investigating the environment reveals a critical discrepancy in certificate configuration. Running php -r 'var_dump(openssl_get_cert_locations());' exposes that the default certificate file is located at /opt/lampp/share/openssl/cert.pem. However, the fields ini_cafile and ini_capath are empty strings. This indicates that the OpenSSL installation bundled with XAMPP does not have a valid Certificate Authority (CA) bundle configured in its initialization settings. Without these files, OpenSSL cannot verify the chain of trust required to establish a secure connection to HTTPS endpoints like Packagist or Get Composer.

The fact that PHP 5.5.19 works correctly while PHP 5.6.3 fails suggests that the version upgrade either introduced stricter SSL validation defaults or replaced the underlying OpenSSL library without carrying over the necessary certificate files. Modern TLS protocols have become significantly more secure, and older configurations often lack the root certificates required to validate servers that use newer signing authorities (such as Let's Encrypt or DigiCert).

To resolve this issue, you must explicitly point PHP and Composer to a valid CA bundle. The most reliable method is to install the ca-certificates package on your system and link it to the environment where XAMPP resides, or configure the OpenSSL configuration file directly within the XAMPP installation directory.

You can verify the availability of a standard CA bundle by running:

ls -la /etc/ssl/certs/ca-certificates.crt

If this file exists, you need to update your PHP configuration to use it. Since the error originates from the CLI or the XAMPP environment, you should edit the php.ini file associated with your stack (often found at /opt/lampp/etc/php.ini or within the specific XAMPP installation path). Add or modify the following directives:

openssl.cafile=/etc/ssl/certs/ca-certificates.crt
openssl.capath=/etc/ssl/certs

Alternatively, if you prefer to keep your CA certificates directly within the XAMPP directory, you can copy ca-certificates.crt from /etc/ssl/certs/ to /opt/lampp/share/openssl/certs/ and update the default values shown in your diagnostic output accordingly. Once the configuration is updated, restart the XAMPP services or clear the Composer cache to ensure the new SSL settings take effect:

composer clear-cache
php -r "echo 'SSL Test';" 

After applying these changes, run composer update again. The command should now successfully download the repository index from Packagist without triggering an SSL verification failure. This approach ensures that your Composer instance operates with a trusted root store, preventing future issues related to certificate revocation lists or updated CA hierarchies.

Our network