[英]How mpesa ssl handshake failure
With the mpesa B2C integration. 与mpesa B2C集成。 am trying to use Curl 正在尝试使用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);
}
I get an error 我得到一个错误
error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure' 错误:14094410:SSL例程:SSL3_READ_BYTES:sslv3警报握手失败'
This is after changing ssl version from nss to openssl. 这是在将ssl版本从nss更改为openssl之后的。 How do I solve the handshake failure. 如何解决握手失败。
If I remember correctly, MPESA uses some public-private key pairs that you need to generate in conjunction with them. 如果我没记错的话,MPESA会使用一些需要与它们结合生成的公钥-私钥对。 If you don't have those set up right, your SSL requests will fail. 如果您的设置不正确,您的SSL请求将失败。 Have you done this yet? 你做完了吗?
Safaricom has released M-Pesa APIs as RESTful APIs accessible through their developer portal . Safaricom已将M-Pesa API作为RESTful API发布,可通过其开发人员门户进行访问。 You need not have SSL certificates signed by Safaricom in order to consume the APIs. 您不需要具有由Safaricom签名的SSL证书即可使用这些API。 As long as your server has a publicly signed certificate, the Safaricom API Gateway should be able to receive requests and send responses to your server. 只要您的服务器具有公开签署的证书,Safaricom API网关就应该能够接收请求并将响应发送到您的服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.