简体   繁体   中英

Composer curl error 60: SSL certificate problem: self signed certificate in certificate chain

I'm working with Symfony 5 and I need to install 'knplabs/knp-snappy-bundle' with composer but I have this message:

[Composer\Downloader\TransportException]
  curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: self signed certificate in certificate chain

please help me

I tried to add cacert.pem into my php.ini with

curl.cainfo ="C:/wamp64/bin/php/php7.3.21/extras/ssl/cacert.pem"

I tried to disable the verify_peer in my composer.json and nothing is working.

this is my composer diag :

Checking composer.json: WARNING
require.composer/package-versions-deprecated : exact version constraints (1.11.99.1) should be avoided if the package follows semantic versioning

Checking platform settings: OK

Checking git settings: OK

Checking http connectivity to packagist: OK

Checking https connectivity to packagist: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://repo.packagist.org/packages.json: SSL certificate problem: self signed certificate in certificate chain

Checking github.com rate limit: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://api.github.com/rate_limit: SSL certificate problem: self signed certificate in certificate chain

Checking disk free space: OK

Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK

Checking composer version: FAIL
[Composer\Downloader\TransportException] curl error 60 while downloading https://getcomposer.org/versions: SSL certificate problem: self signed certificate in certificate chain

Composer version: 2.0.13
PHP version: 7.3.21
PHP binary path: C:\wamp64\bin\php\php7.3.21\php.exe
OpenSSL version: OpenSSL 1.1.1g  21 Apr 2020
cURL version: 7.70.0 libz 1.2.11 ssl OpenSSL/1.1.1g
zip: extension present, unzip present

please help me


may be my composer config have a problem

 "config": { "optimize-autoloader": true, "preferred-install": { "*": "dist" }, "sort-packages": true, "options": { "ssl": { "verify_peer": false, "allow_self_signed": false, "cafile": "C:/wamp64/bin/php/php7.3.21/extras/ssl/cacert.pem", "local_cert": "C:/wamp64/bin/php/php7.3.21/extras/ssl/cacert.pem" } } },

检查路由器是否没有阻止 https 端口?

may be my composer config have a problem

 "config": { "optimize-autoloader": true, "preferred-install": { "*": "dist" }, "sort-packages": true, "options": { "ssl": { "verify_peer": false, "allow_self_signed": false, "cafile": "C:/wamp64/bin/php/php7.3.21/extras/ssl/cacert.pem", "local_cert": "C:/wamp64/bin/php/php7.3.21/extras/ssl/cacert.pem" } } },

This configuration option: allow_self_signed comes from nowhere, it has no effect; It doesn't even appear in the documentation of composer.

I lost hours of precious time due to this misleading option.

If you have a similar problem I would recommend to use the latest version of PHP (that meets your requirements, obviously) and the latest composer version, etc. Works for me, but YMMV.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM