OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
我通过curl在基于ssl means(https)的api上放置订单数据,但它返回OpenSSL SSL_read:SSL_ERROR_SYSCALL,errno 104消息。
以下是我的测试代码,根据客户端所需的json:
$apiKey = "xxxxxx-xxxxxx-xxxxx-xxxxxx-xxxxxx";
$privatekey = "xxxxxx-xxxxxx-xxxxx-xxxxxx-xxxxxx";
$timestamp = date('Y-m-d H:i:s'); // (for example: 2016-07-19 14:05:55)
$signature = hash_hmac('sha1', $timestamp, $apiKey);
$signature = hash_hmac('sha1', $privatekey, $signature);
$postURL = "https://www.compu-cover.com/intelligent-rewards/orders/?OrderNo=123";
$orderInfo['Order'] = array(
"apiKey" => $apiKey,
"privatekey" => $privatekey,
"Signature" => $signature,
"Timestamp" => $timestamp,
"Firstname" => "Ajay",
"Surname" => "Sharma",
"EmailAddress" => "ajay@yopmail.com",
"DaytimeTel" => "0141798526",
"EveningTel" => "0141798526",
"MobileTel" => "9887654321",
"Address1" => "A-5",
"Address2" => "Jhalana",
"Address3" => "Jaipur",
"Address4" => "Rajasthan",
"County" => "India",
"Postcode" => "302019",
"Cover" => "ADTBL",
"Scheme" => 2,
"Premium" => 5,
"EquipmentQty" => 1,
"EquipmentType1" => "Smartphone",
"EquipmentMake1" => "Moto",
"EquipmentModel1" => "Moto G",
"EquipmentPrice1" => 100
);
$params = json_encode($orderInfo);
$session = curl_init($postURL);
curl_setopt($session, CURLOPT_POST, true);
curl_setopt($session, CURLOPT_POSTFIELDS, $params);
curl_setopt($session, CURLOPT_HEADER, true);
curl_setopt($session, CURLOPT_SSL_VERIFYPEER, true);
$response = curl_exec($session);
if (FALSE === $response) {
var_dump(curl_error($session));
var_dump(curl_errno($session));
}
curl_close($session);
$response = json_decode($response);
var_dump($response);
如何找到失败的原因?失败的原因可能是什么?请提供您的建议。