简体   繁体   English

cURL 错误 60 没有消失

[英]cURL error 60 not disappearing

I'm trying to connect the google/apiclient to my web application.我正在尝试将 google/apiclient 连接到我的网络应用程序。 I'm using it to allow members to sign in with their Google accounts.我正在使用它来允许成员使用他们的 Google 帐户登录。 So far, I can reach the Request for Permission Google page where Google asks the user if they will allow their information to be shared with my application.到目前为止,我可以访问 Google 许可请求页面,在该页面中,Google 询问用户是否允许与我的应用程序共享他们的信息。 When I click on the allow button, The following happens当我单击允许按钮时,会发生以下情况

在此处输入图片说明

I've researched extensively and I've found several posts that suggest that this problem shows up when your CA root certificates are missing or out-of-date.我已经进行了广泛的研究,我发现一些帖子表明当您的 CA 根证书丢失或过期时会出现此问题。 The proposed solution is to:建议的解决方案是:

  1. Download the cacert.pem from https://curl.haxx.se/docs/caextract.htmlhttps://curl.haxx.se/docs/caextract.html下载 cacert.pem
  2. Save the file with the .pem extension.使用 .pem 扩展名保存文件。 I also tried to save the file with the .crt extension.我还尝试使用 .crt 扩展名保存文件。 I saved the file in the following directory C:\\wamp\\bin\\php\\php5.5.12\\extras\\curl-ca-bundle.crt我将文件保存在以下目录 C:\\wamp\\bin\\php\\php5.5.12\\extras\\curl-ca-bundle.crt
  3. Update my php.ini file by setting curl.cainfo to the path where the downloaded was saved.通过将 curl.cainfo 设置为保存下载的路径来更新我的 php.ini 文件。 The php.ini file that I updated is at C:\\wamp\\bin\\apache\\apache2.4.9\\bin\\php.ini (Please note that, I used phpinfo() to make sure that I was editing the correct php.ini file. )我更新的 php.ini 文件位于 C:\\wamp\\bin\\apache\\apache2.4.9\\bin\\php.ini (请注意,我使用 phpinfo() 来确保我正在编辑正确的 php.ini文件。 )
  4. Restart all my services and voila the error should disappear.重新启动我的所有服务,瞧,错误应该消失了。

Following those instructions seems to work for other developers but my error does not disappear.遵循这些说明似乎适用于其他开发人员,但我的错误并没有消失。 Are there other settings that need to be updated or changed?是否还有其他设置需要更新或更改? What else can I do?我还可以做些什么? Where did I go wrong?我哪里做错了?

The correct answer is indeed to download the cacert.pem file and update the php.ini files as suggested by Morfinismo.正确的答案确实是下载 cacert.pem 文件并按照 Morfinismo 的建议更新 php.ini 文件。

But even after that the error did not disappear.但即使在那之后,错误也没有消失。 The trick was getting a clean copy of the PEM file!诀窍是获得 PEM 文件的干净副本! Any method involving windows notepad or other editors corrupts the file and gives the cURL error 60 etc. Finally, I found https://gist.github.com/VersatilityWerks/5719158/download and downloaded a tar file with a clean copy of the cacert.pem file ...... it then all worked perfectly.任何涉及 Windows 记事本或其他编辑器的方法都会损坏文件并给出 cURL 错误 60 等。最后,我找到了https://gist.github.com/VersatilityWerks/5719158/download并下载了一个带有 cacert 干净副本的 tar 文件.pem 文件......然后一切正常。

I also made the following changes in WAMP SERVER:我还在 WAMP SERVER 中进行了以下更改:

  • In APACHE, I activated the ssl_module在 APACHE 中,我激活了 ssl_module
  • In PHP, I made sure that my php_curl extension was also active在 PHP 中,我确保我的 php_curl 扩展也处于活动状态
  • I downloaded cURL with SSL enabled from the following website and I saved the curl.exe in the same folder where the cacert.pem file is stored我从以下网站下载了启用 SSL 的 cURL,并将 curl.exe 保存在存储 cacert.pem 文件的同一文件夹中

Hope this saves others time.希望这可以节省其他人的时间。

WAMP has two directories that need an update. WAMP 有两个需要更新的目录。

  • C:\\wamp\\bin\\apache\\apacheversion\\bin\\php.ini
  • C:\\wamp\\bin\\php\\phpversion\\php.ini . C:\\wamp\\bin\\php\\phpversion\\php.ini

Open both files, look for the line curl.cainfo = and include the path to the certificate you've downloaded, restart the services and it should work.打开这两个文件,查找curl.cainfo =行并包含您下载的证书的路径,重新启动服务,它应该可以工作。

I hope this helps!我希望这有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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