我正在使用此php脚本进行avile:
if(file_exists("/var/www/vhosts/domain.com/httpdocs/import/ca.pem")
&& file_exists("/var/www/vhosts/domain.com/httpdocs/import/client.pem")
&& file_exists("/var/www/vhosts/domain.com/httpdocs/import/key.pem"))
{
$ch =curl_init();
curl_setopt($ch, CURLOPT_SSLVERSION,3);
curl_setopt($ch,
CURLOPT_URL,"https://b2b.kimtec.ba/B2BService/HTTP/Product/GetProductsPriceList.aspx");
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($ch, CURLOPT_CAINFO, realpath("/var/www/vhosts/domain.com/httpdocs/import/ca.pem"));
curl_setopt($ch, CURLOPT_SSLCERT, realpath("/var/www/vhosts/domain.com/httpdocs/import/client.pem"));
curl_setopt($ch, CURLOPT_SSLKEY, realpath("/var/www/vhosts/domain.com/httpdocs/import/key.pem"));
curl_setopt($ch, CURLOPT_SSLKEYPASSWD, "XXXX"); // pin vezan za B2B certifikat
$return = curl_exec ($ch);
echo $return;
echo curl_error($ch);
curl_close ($ch);
}
但是在证书更改后我遇到了问题,我在错误日志中得到了这个提示:
无法加载客户端密钥:-8178(SEC_ERROR_BAD_KEY)
浏览器中的黑屏。
我在本地测试证书,效果很好。