When doing a composer update on my Laminas projects with composer (on a Windows Machine with PHP 8.3 and Apache 2.4) out of the blue this error appeared 2 days ago (before that I used it with success):
curl error 60 while downloading .json: SSL certificate problem: unable to get local issuer certificate
What I tried (without success):
- Disabling Anti Virus (caveat: see answer)
- Downloading latest cacert.pem and changed php.ini to the location with the certificate (curl.cainfo and openssl.cafile).
- Update composer version (I had to change "disable-tls": false in composer config.json and then it worked)
- Removed latest windows update
- composer self-update --update-keys
I'm running out of options and I am googling for 2 days now and tried a lot, but was unable to find a solution for this problem.
composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: No git process found
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading .json: SSL certificate problem: unable to get local issuer certificate
Checking github rate limit: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading : SSL certificate problem: unable to get local issuer certificate
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: ***
Dev Public Key Fingerprint: ***
OK
Checking Composer version: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading : SSL certificate problem: unable to get local issuer certificate
Checking Composer and its dependencies for vulnerabilities: Failed performing audit: curl error 60 while downloading .json: SSL certificate problem: unable to get local issuer certificate
Composer version: 2.8.5
PHP version: 8.3.17
PHP binary path: C:\PHP\php.exe
OpenSSL version: OpenSSL 3.0.15 3 Sep 2024
curl version: 8.7.0-DEV libz 1.2.12 ssl OpenSSL/3.0.15
zip: extension present, unzip not available, 7-Zip not available
Procedure to download cacert.pem
- Go to .html
- Downloaded cacert.pem
- uploaded it to cert location of composers config.php
- To check the hash i added this line to some PHP file: echo hash_file('sha256', 'example.txt', false);
- That hash does not match the hash in the downloaded certificate or the "Here's the sha256sum of the current PEM file" link
HASH in downloaded cacert.pem -> SHA256: ***d3aca3c05c566d8dc98e116
HASH in PHP file -> ***b934ca495991b7852b855
HASH when using link .pem.sha256 -> ***90425d7da901a11531b3aa5
When doing a composer update on my Laminas projects with composer (on a Windows Machine with PHP 8.3 and Apache 2.4) out of the blue this error appeared 2 days ago (before that I used it with success):
curl error 60 while downloading https://repo.packagist./packages.json: SSL certificate problem: unable to get local issuer certificate
What I tried (without success):
- Disabling Anti Virus (caveat: see answer)
- Downloading latest cacert.pem and changed php.ini to the location with the certificate (curl.cainfo and openssl.cafile).
- Update composer version (I had to change "disable-tls": false in composer config.json and then it worked)
- Removed latest windows update
- composer self-update --update-keys
I'm running out of options and I am googling for 2 days now and tried a lot, but was unable to find a solution for this problem.
composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: No git process found
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://repo.packagist./packages.json: SSL certificate problem: unable to get local issuer certificate
Checking github rate limit: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://api.github/rate_limit: SSL certificate problem: unable to get local issuer certificate
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: ***
Dev Public Key Fingerprint: ***
OK
Checking Composer version: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://getcomposer./versions: SSL certificate problem: unable to get local issuer certificate
Checking Composer and its dependencies for vulnerabilities: Failed performing audit: curl error 60 while downloading https://repo.packagist./packages.json: SSL certificate problem: unable to get local issuer certificate
Composer version: 2.8.5
PHP version: 8.3.17
PHP binary path: C:\PHP\php.exe
OpenSSL version: OpenSSL 3.0.15 3 Sep 2024
curl version: 8.7.0-DEV libz 1.2.12 ssl OpenSSL/3.0.15
zip: extension present, unzip not available, 7-Zip not available
Procedure to download cacert.pem
- Go to https://curl.se/docs/caextract.html
- Downloaded cacert.pem
- uploaded it to cert location of composers config.php
- To check the hash i added this line to some PHP file: echo hash_file('sha256', 'example.txt', false);
- That hash does not match the hash in the downloaded certificate or the "Here's the sha256sum of the current PEM file" link
HASH in downloaded cacert.pem -> SHA256: ***d3aca3c05c566d8dc98e116
HASH in PHP file -> ***b934ca495991b7852b855
HASH when using link https://curl.se/ca/cacert.pem.sha256 -> ***90425d7da901a11531b3aa5
Share Improve this question edited Feb 17 at 7:41 hakre 198k55 gold badges446 silver badges854 bronze badges Recognized by PHP Collective asked Feb 15 at 15:56 Jilco TigchelaarJilco Tigchelaar 2,1878 gold badges32 silver badges55 bronze badges 13 | Show 8 more comments1 Answer
Reset to default 1I am using Norton Antivirus, and I disabled the "HTTPS Scanning" option within the "Safe Web" feature as outlined in All HTTPS connections outside of browser fail with "SSL certificate problem: unable to get local issuer certificate"
This prevented the curl error 60 in composer.
For reference: https://curl.se/libcurl/c/libcurl-errors.html#CURLEPEERFAILEDVERIFICATION
CURLE_PEER_FAILED_VERIFICATION (60)
The remote server's SSL certificate or SSH fingerprint was deemed not OK.
composer diagnose
. – hakre Commented Feb 15 at 16:04composer diagnose -vvv
composer may also show location of cert paths, which can be helpful for you. – hakre Commented Feb 15 at 16:29