composer ssl3_get_server_certificate:certificate verify failed

  • 使用 composer命令
    composer self-update

    composer require wechatpay/wechatpay

  • 都出现以下问题:
    image
    [Composer\Downloader\TransportException]
    The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Erro
    r messages:
    error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
    Failed to enable crypto
    failed to open stream: operation failed

  • composer使用了PHP命令进行操作,所以,需要开启openssl、配置证书
    证书下载地址:http://curl.haxx.se/ca/cacert.pem

  • 配置php.ini这两项,注意换成自己的证书路径
    curl.cainfo ="c:/cert.pem"
    openssl.cafile = "c:/cert.pem"

  • 再来一次 composer self-update ,运行不报错
    image

欢迎关注公众号:夜说猫,靓仔程序员每周新闻点评~
完。

posted @ 2023-02-18 21:03  Yoper  阅读(122)  评论(0编辑  收藏  举报