SSL certificate error: unable to get local issuer certificate when authenticating with Podio

放肆的年华 提交于 2019-12-25 04:08:25

问题


I am trying to use the Podio API for the first time, and am trying to run the Hello World script on this page, but I keep getting this error:

Here is my code:

<?php
require_once './vendor/podio/podio-php/PodioAPI.php';

$client_id = "<my_id>";
$client_secret = "<my_secret>";
$app_id = "<my_app_id>";
$app_token = "<my_app_token>";

Podio::setup($client_id, $client_secret);
Podio::authenticate_with_app($app_id, $app_token);
$items = PodioItem::filter($app_id);

print "My app has ".count($items)." items";
?>

When I comment out the last three lines and just run this:

<?php
require_once './vendor/podio/podio-php/PodioAPI.php';

$client_id = "<my_id>";
$client_secret = "<my_secret>";
$app_id = "<my_app_id>";
$app_token = "<my_app_token>";

Podio::setup($client_id, $client_secret);

?>

The code runs without errors, So that leads me to believe that it is a problem with the app token, but I got the app token by following these instructions

What is wrong here?

When I got my api key, I put in a fake url, because I am running this test my computer. Could that be the issue?


回答1:


I solved this by downloading cacert.pem from this site https://curl.haxx.se/docs/caextract.html into my C:\xampp\php directory. I then uncommented/edited these lines in my php.ini file

curl.cainfo = "C:\xampp\php\cacert.pem" 
openssl.cafile="C:\xampp\php\cacert.pem"


来源:https://stackoverflow.com/questions/41083951/ssl-certificate-error-unable-to-get-local-issuer-certificate-when-authenticatin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!