我在 Windows 10 计算机和 Composer 版本 1.9.0 上使用 PHP v7.2composer create-project --prefer-dist laravel/laravel blog我正在尝试安装 Laravel 并使用 Composer 启动一个项目,但出现以下错误OpenSSL 错误消息:错误:1416F086:SSL 例程:tls_process_server_certificate:证书验证失败当我运行composer diagnose低于结果时PS C:\xampp\htdocs\webstore_services> composer 诊断 检查平台设置:OK 检查 git 设置:OK 检查 http 与 packagist 的连接:警告:通过 http 访问 192.168.1xx.2xx,这是一种不安全的协议。OK 检查与 packagist 的 https 连接:[Composer\Downloader\TransportException]无法下载“ https://repo.packagist.org/packages.json ”文件:SSL 操作失败,代码为 1。OpenSSL 错误消息:错误:1416F086 :SSL 例程:tls_process_server_certificate:certificate verify failed 无法启用加密无法打开流:操作失败检查 github.com 速率限制:失败 [Composer\Downloader\TransportException] “ https://api.github.com/rate_limit" 文件无法下载:SSL 操作失败,代码为 1。OpenSSL 错误消息:错误:1416F086:SSL 例程:tls_process_server_certificate:证书验证失败无法启用加密无法打开流:操作失败正在检查磁盘可用空间:OK 检查公钥:标签公共密钥指纹:57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642开发公钥指纹:4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952 OK检查作曲家版本:[作曲\下载\ TransportException]的“ https://getcomposer.org/versions ”文件无法下载:SSL 操作失败,代码为 1。OpenSSL 错误消息:错误:1416F086:SSL 例程:tls_process_server_certificate:证书验证失败无法启用加密无法打开流:操作失败诊断我已经尝试了几乎所有互联网上的解决方案php -r "print_r(openssl_get_cert_locations());"结果( [default_cert_file] => C:\usr\local\ssl/cert.pem [default_cert_file_env] => SSL_CERT_FILE [default_cert_dir] => C:\usr\local\ssl/certs [default_cert_dir_env] => SSL_CERT_DIR [default_private_dir] => C:\usr\local\ssl/private [default_default_cert_area] => C:\usr\local\ssl [ini_cafile] => C:\xampp\php\cacert.pem [ini_capath] => C:\xampp\php\cacert.pem)我将如何更改default_cert_filein this的位置,只剩下 this 了?由于我在公司代理上,我设置了代理的环境变量。https_proxy : http://user:pass@host:port http_proxy : http://user:pass@host:port在我所做的一切之后,它对我没有帮助。
2 回答

千巷猫影
TA贡献1829条经验 获得超7个赞
我不知道我是否会回答你,但我会尽力启发你:
这是安全连接失败:生成证书时定义了 default_cert_file
错误:1416F086:SSL 是一个错误,例如 服务器拒绝您的证书,因为它已被吊销、不存在或不正确 ,当安全证书无效或不再有效时,浏览器中可能会发生相同的错误,错误代码为:SSL_ERROR_REVOKED_CERT_ALERT 或 SSL_ERROR_HANDSHAKE_FAILURE_ALER
当您生成根证书时,这可能取决于一个配置文件,其中指定了几个信息,特别是路径:
[CA_default] dir = ./certificats # 保存所有东西的地方
openssl 等...
我认为你正在寻找的是相似的
SSL 上下文选项 SSL 上下文选项 — SSL 上下文选项列表
咖啡馆字符串
Location of Certificate Authority file on local filesystem which should be used with the verify_peer context option to authenticate the identity of the remote peer.
大写字符串
If cafile is not specified or if the certificate is not found there, the directory pointed to by capath is searched for a suitable certificate. capath must be a correctly hashed certificate directory.

明月笑刀无情
TA贡献1828条经验 获得超4个赞
此错误的最常见原因是日期/时间不同步,请检查您机器的本地时间并使用诸如 ntp 或 chrony 之类的命令来同步您的时间。
如果您在 docker 容器中遇到此问题,则容器将使用您的主机时间。但是,将计算机置于休眠模式会使时间锁定。唯一的解决办法是重新启动整个计算机。
- 2 回答
- 0 关注
- 1910 浏览
添加回答
举报
0/150
提交
取消