gpt4 book ai didi

php - OpenSSL 错误消息 : error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

转载 作者:行者123 更新时间:2023-12-03 11:21:21 26 4
gpt4 key购买 nike

我在 Windows 10 计算机和 Composer 版本 1.9.0 上使用 PHP v7.2
composer create-project --prefer-dist laravel/laravel blog
我正在尝试安装 Laravel 并使用 Composer 启动一个项目,但出现以下错误

OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed



当我跑 composer diagnose低于结果

PS C:\xampp\htdocs\webstore_services> composer diagnose Checking platform settings: OK Checking git settings: OK Checking http connectivity to packagist: Warning: Accessing 192.168.1xx.2xx over http which is an insecure protocol. OK Checking https connectivity to packagist: [Composer\Downloader\TransportException] The "https://repo.packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed Failed to enable crypto failed to open stream: operation failed Checking github.com rate limit: FAIL [Composer\Downloader\TransportException] The "https://api.github.com/rate_limit" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed Failed to enable crypto failed to open stream: operation failed 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: [Composer\Downloader\TransportException]
The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
diagnose



我已经尝试了几乎所有互联网上的解决方案
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_file 的位置在这,就只剩下这个了?

由于我在公司代理上,我设置了代理的环境变量。

https_proxy : http://user:pass@host:port
http_proxy : http://user:pass@host:port

在我所做的一切之后,它对我没有帮助。

最佳答案

我不知道我是否会回答你,但我会尽力启发你:

这是一个安全连接失败:
生成证书时定义了 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.

关于php - OpenSSL 错误消息 : error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57358047/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com