使用mpesa B2C集成。我想用Curl
$url = "https://196.201.214.136:18423/mminterface/request";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
// curl_setopt($ch, CURLOPT_PORT, 18423);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $requestXml);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-type: text/xml',
'Content-length: ' . strlen($requestXml)
));
$output = curl_exec($ch);
if(curl_errno($ch)){
var_dump(curl_error($ch));
} else{
curl_close($ch);
}我得到了一个错误
错误:14094410:SSL routines:SSL3_READ_BYTES:sslv3警报握手失败
这是在将ssl版本从nss更改为openssl之后。我该如何解决握手失败。
发布于 2016-08-12 17:55:17
如果我没记错的话,MPESA使用一些您需要与它们一起生成的公共-私钥对。如果没有正确设置这些请求,则SSL请求将失败。你做过了吗?
发布于 2017-12-05 14:39:39
Safaricom已经发布了M,作为RESTful API通过其开发人员门户访问。您不需要由Safaricom签署SSL证书就可以使用API。只要您的服务器有公开签名的证书,Safaricom API网关就应该能够接收请求并向服务器发送响应。
https://stackoverflow.com/questions/38919383
复制相似问题