gpt4 book ai didi

php - mpesa ssl握手失败怎么办

转载 作者:太空宇宙 更新时间:2023-11-03 13:15:53 24 4
gpt4 key购买 nike

与 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);
}

我收到一个错误

error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure'

这是在将 ssl 版本从 nss 更改为 openssl 之后。如何解决握手失败。

最佳答案

如果我没记错的话,MPESA 使用了一些您需要与它们一起生成的公私 key 对。如果您没有正确设置这些,您的 SSL 请求将失败。你做到了吗?

关于php - mpesa ssl握手失败怎么办,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38919383/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com