简体   繁体   中英

cURL error 60 not disappearing

I'm trying to connect the google/apiclient to my web application. I'm using it to allow members to sign in with their Google accounts. 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. 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. The proposed solution is to:

  1. Download the cacert.pem from https://curl.haxx.se/docs/caextract.html
  2. Save the file with the .pem extension. I also tried to save the file with the .crt extension. I saved the file in the following directory 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. 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. )
  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.

But even after that the error did not disappear. The trick was getting a clean copy of the PEM file! 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.

I also made the following changes in WAMP SERVER:

  • In APACHE, I activated the ssl_module
  • In PHP, I made sure that my php_curl extension was also active
  • 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

Hope this saves others time.

WAMP has two directories that need an update.

  • C:\\wamp\\bin\\apache\\apacheversion\\bin\\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.

I hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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