NSS:找不到客户端证书(昵称未指定)php curl

时间:2018-05-25 13:35:45

标签: php curl nss

我正在尝试使用php中的curl访问某个网站,但它会返回我:

  

NSS:未找到客户端证书(未指定昵称)

代码是这样的:

$headers = Array("Content-Type: text/xml");

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://nameofsite....");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $XmlString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_TIMEOUT , 100);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_CAINFO,'./mycert.pem');
curl_setopt($ch,CURLOPT_CAPATH,'./mycert.pem');
curl_setopt($ch,CURLOPT_SSLCERTPASSWD, 'pswmycert');
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , 10);

0 个答案:

没有答案