【问题标题】:Test twitters php api locally without ssl在没有 ssl 的情况下在本地测试 twitters php api
【发布时间】:2016-03-21 06:24:50
【问题描述】:

我正在尝试通过 php 让 twitter 发布到我的墙上,而我能看到的唯一方法是首先拥有一个 auth tocken,然后我需要向 twitter 询问它:) Facebook 做得更好;p

所以我正在使用ricardoper/twitteroauth 来执行此操作,并且在尝试获取令牌时,我通过点击此处看到的 curl 文件将其取回:https://github.com/ricardoper/TwitterOAuth/blob/v2/src/Common/Curl.php

我不确定是因为我在本地运行 php 还是与 twitter 有关。

<br />
<b>Fatal error</b>:  Uncaught cURL Lib: [60] SSL certificate problem: unable to get local issuer certificate (TwitterOAuth\Exception\CurlException) 
  thrown in <b>C:\var\www\fbshare\TwitterOAuth\src\Common\Curl.php</b> on line <b>110</b><br />

我怎样才能克服这个错误,或者能够在 twitter 上发帖,但我相信这个脚本可以做到。

【问题讨论】:

    标签: php curl twitter twitter-oauth


    【解决方案1】:

    原来我使用的 pem 的 repo 不支持本地主机上的 ssl。

    我从here下载了一个本地的ssl证书

    将第 64 行替换为 CURLOPT_CAINFO =&gt; '/var/www/cacert.pem',,这是从上面给出的链接下载的 pem,现在我可以在本地访问 ssl :)

    【讨论】:

      猜你喜欢
      • 2015-03-03
      • 1970-01-01
      • 1970-01-01
      • 2020-12-01
      • 1970-01-01
      • 2019-12-17
      • 1970-01-01
      • 1970-01-01
      • 2021-01-27
      相关资源
      最近更新 更多