1
我正在做一個似乎拋出一些錯誤的api調用。所以basicall我的腳本使用捲曲做了SOAP API調用後,它拋出(60): SSL certificate problem: unable to get local issuer certificate
PHPcURL錯誤(60):SSL證書問題:無法獲得本地發行者證書
我已經試過
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
,但它不工作的錯誤。
我也曾嘗試以下操作:
$ch = curl_init(); // initialize curl handle
//curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, "GeoTrustGlobalCA.crt");
curl_setopt($ch, CURLOPT_URL, $ENDPOINT);
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,0);
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
//curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
//curl_setopt($ch, CURLOPT_PORT, 80);
$data = curl_exec($ch);
$curl_errno = curl_errno($ch);
$curl_error = curl_error($ch);
if ($curl_errno > 0) {
echo "cURL Error ($curl_errno): $curl_error\n";
} else {
echo "Data received. To complete this transaction, enter your Bonga PIN on your handset. if you don't have one dial *126*5# for instructions\n";
echo $data;
}
curl_close($ch);
一切似乎是工作。任何解決方法?順便說一句的是$ENDPOINT
https://safaricom.co.ke
確保OpenSSL設置正確。 –
您是否嘗試將端點更改爲'https:// www.safaricom.co.ke',因爲這是證書唯一有效的域? – Chris
另外,當Verisign(通過Symantec)簽署證書時,爲什麼使用GeoTrust全局CA?此外,服務器缺少證書鏈中的證書,這使得適當的驗證更加困難。 – Chris