【问题标题】:SSL certificate error: unable to get local issuer certificate when authenticating with PodioSSL 证书错误:使用 Podio 进行身份验证时无法获取本地颁发者证书
【发布时间】:2017-04-26 07:42:38
【问题描述】:

我第一次尝试使用 Podio API,并尝试在 this page 上运行 Hello World 脚本,但我不断收到此错误:

这是我的代码:

<?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";
?>

当我注释掉最后三行并运行以下代码时:

<?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);

?>

代码运行没有错误,所以这让我相信这是应用令牌的问题,但我通过关注these instructions获得了应用令牌

这里有什么问题?

当我得到我的 api 密钥时,我输入了一个假 URL,因为我正在运行这个测试我的计算机。会不会是这个问题?

【问题讨论】:

标签: php asp.net-web-api podio


【解决方案1】:

我通过从该站点https://curl.haxx.se/docs/caextract.html 下载cacert.pem 到我的C:\xampp\php 目录中解决了这个问题。然后我在我的 php.ini 文件中取消注释/编辑了这些行

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

【讨论】:

    猜你喜欢
    • 2015-03-18
    • 2011-12-26
    • 2016-07-06
    • 2018-06-11
    • 1970-01-01
    相关资源
    最近更新 更多