簡體   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