OpenSSL 错误消息:错误:14090086:SSL 例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败未能启用加密 [英] OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed Failed to enable crypto
问题描述
我正在使用 OS X Yosemite
I am using OS X Yosemite
我在 Composer 中运行了以下命令,因为 Laravel 一直无法正确下载和安装:
I ran the following command in Composer because Laravel fails to download and install properly all the time:
作曲家诊断
结果:
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: FAIL
[ComposerDownloaderTransportException] The "https://packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Checking github.com rate limit: FAIL
[ComposerDownloaderTransportException] The "https://api.github.com/rate_limit" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
failed to open stream: operation failed
Checking disk free space: OK
Checking composer version:
[ComposerDownloaderTransportException]
The "https://getcomposer.org/version" file could not be downloaded: SSL ope
ration failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify
failed
Failed to enable crypto
failed to open stream: operation failed
我要重点关注的主线是:
The main line I want to focus on is:
SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Failed to enable crypto
我该如何解决这个问题.我在网上尝试了几种解决方案,但都没有奏效.我对命令行的使用完全陌生.
How can I fix this. I have tried several solutions on the web and none have worked. I am totally new to the use of the command line.
使用以下命令下载和安装 Laravel 时:composer create-project laravel/laravel --prefer-dist
我不能自己手动下载东西并将其放在正确的文件夹中避免这个 SSL 问题?
When downloading and installing Laravel with the following command: composer create-project laravel/laravel --prefer-dist
can't I just manually download the stuff myself and place it in the correct folder to avoid this SSL problem?
推荐答案
注意:我运行的是 OS X Yosemite.我相信这也适用于小牛队.
Note: I am running OS X Yosemite. I believe this works with Mavericks too.
在查看了几个答案并将它们组合混合和匹配等之后.这是我所做的粗略解释.
After looking a several answers and combining them mixing and matching etc. Here is a rough explanation on what I did.
- 打开命令行并运行:
找到 cacert.pem
这将列出您的证书所在的所有位置.
This will list all the locations where your certificates are.
我的结果:
/Applications/Adobe Dreamweaver CS6/Configuration/Certs/cacert.pem
/Applications/MAMP/Library/lib/python2.7/test/pycacert.pem
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip/_vendor/requests/cacert.pem
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/pycacert.pem
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/test/test_asyncio/pycacert.pem
/Users/robert/.composer/cacert.pem
/opt/vagrant/embedded/cacert.pem
/usr/ssl/certs/cacert.pem
- 我从 curl 下载了最新的一个
http://curl.haxx.se/docs/caextract.html
- 我在
/usr/ssl/certs/
中创建了一个目录
- I made a directory in
/usr/ssl/certs/
并将下载的证书放在那里/usr/ssl/certs/cacert.pem
and put the downloaded cert there /usr/ssl/certs/cacert.pem
我打开了我的 php.ini 文件并将这一行放在文件的顶部:
openssl.cafile=/usr/ssl/certs/cacert.pem
重启 apache(停止 apache 并重新启动)
Restart apache (stop apache and start it again)
一切都为我解决了.
现在我认为需要做的一件事是您需要告诉命令行您指的是哪个 PHP.我在 XAMPP 下运行 PHP,而不是在我的 OS X 上运行 PHP.所以命令行会认为您指的是 OS X 上的原生 PHP,而不是在 XAMPP 上运行的 PHP.我相信这需要改变才能奏效.如果没有,那应该很好.
Now one thing that I do believe needs to be done is you need to tell the command line which PHP you are referring to. I am running PHP under XAMPP and not natively on my OS X. So the command line will think that you are referring to the native PHP on OS X and not the one running on XAMPP. This needs to be changed I believe for this to work. If not then it should be good.
如前所述,此解决方案对我有用.
As mentioned this solution worked for me.
这篇关于OpenSSL 错误消息:错误:14090086:SSL 例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败未能启用加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!