繁体   English   中英

heartbleed 会影响 iTunes 的第 3 方 php 服务器接收验证吗?

[英]heartbleed affect the 3rd party php server receipt verify of itunes?

我有一个有效的 3rd 方 php 代码验证从 ipad 发送的收据。 但似乎https://sandbox.itunes.apple.com/verifyReceipt不再响应我的 php 代码。 如果我直接访问网址,甚至没有像{"status":21000}这样的错误统计信息。 我在服务器端尝试了不同的方法,比如 curl_exec($ch); 或 file_get_contents 即使是简单的测试也根本没有返回任何内容。

$result = file_get_contents('https://sandbox.itunes.apple.com/verifyReceipt');
echo $result;

我想知道这是否是由心脏出血引起的,我该怎么办?

我原来的工作 php 代码:

if ($isSandbox) {   
        $endpoint = 'https://sandbox.itunes.apple.com/verifyReceipt';   
    }   
    else {   
        $endpoint = 'https://buy.itunes.apple.com/verifyReceipt';   
    }   

// Connect to Apple server and validate.
$postData = json_encode(array("receipt-data" => $receipt));

$options = array(
    'http' => array(
        'header'  => "Content-type: application/x-www-form-urlencoded",
        'method'  => 'POST',
        'content' => $postData
    ),
);
$context  = stream_context_create($options);
$result = file_get_contents($endpoint, false, $context);

好吧,经过几个小时的搜索和检查,我终于弄明白了,这是发生了什么:

  1. 我将测试文件上传到另一台服务器,结果证明它可以工作,所以不是 php 源代码问题。
  2. 我加了

    error_reporting(E_ALL); ini_set('display_errors', '1');

    到 php 文件得到的错误代码是file-get-contents Couldn't resolve host name

  3. 所以我记得昨天我 yum 更新了所有服务器软件来处理 heartbleed。 似乎一些更新修改了resolv.conf。
  4. 我更改了 resolv.conf 添加了 google nameserver 8.8.8.8但仍然无法正常工作
  5. 重启nginx和php-fpm,问题解决

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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