YouTube API,带有https:;Google_IOException:p SSL CA的问题


YouTube API with https: "Google_IOException: p roblem with the SSL CA

缩写:我有一些PHP代码,正在将视频从我的网站上传到YouTube。我使用的是谷歌提供的常用PHP库google-api-php-client。我在两台服务器上运行了这段代码;它对一个有效(https://www.example.com)但突然停止了另一项工作(https://dev.example.com)经过一段时间的良好工作。

详细信息:据我所知,进行传输的代码是相对标准的:一旦加载了库,一些变量得到了一些值,我就在做:

$client = new Google_Client();
$client->setClientId($youtube_client_id);
$client->setClientSecret($youtube_client_secret);
$redirect = filter_var('https://example.com/upload-to-youtube', FILTER_SANITIZE_URL);
$client->setRedirectUri($redirect);
$youtube = new Google_YoutubeService($client);
$client->authenticate();
header('Location: ' . $redirect);

对于不工作的服务器,$client->authenticate行抛出错误:Google_IOException: HTTP Error: (0) Problem with the SSL CA cert (path? access rights?) in Google_CurlIO->makeRequest() (line 128 of /var/www/html/example/includes/google-api-php-client/src/io/Google_CurlIO.php).

其他可能相关的细节:

  • 回到YT应用程序的开发人员控制台,我设置了以下重定向URI:

    https://dev.example.com/delete-from-youtube

    https://dev.example.com/upload-to-youtube

    https://www.example.com/delete-from-youtube

    https://www.example.com/upload-to-youtube

  • 根据我在https://www.sslshopper.com/ssl-checker.html,两个站点上的证书都可见且有效。

  • dev.example.com的证书来自Comodo;www.example.com的证书来自GeoTrust。我想我可以尝试从GeoTrust获得一个新的证书,但我宁愿不花钱,除非我知道它能解决问题。

  • 如果相关的话,两台服务器都在运行相同版本的curl。

(在我看来)证书和对它的访问应该是可以的(除非证书测试人员错了),所以我不明白投诉是从哪里来的。代码和服务器配置已经有很长一段时间没有改变了,因此我搜索了一个外部解释。(我知道这些是著名的遗言,但不管怎样。)有什么想法吗?谢谢

潜在的重复问题:Amazon MarketplaceWebServiceOrders请求突然失败,PHP curl给出SSL CA证书错误?

为了解决这个问题,我不得不重新启动服务器,而不仅仅是apache。