cURL is unable to use client certificate , in local server

两盒软妹~` 提交于 2019-11-29 12:06:57

Try exchanging your files like so:

curl_setopt($ch, CURLOPT_CAINFO, getcwd().'ipm.pem');
curl_setopt($ch, CURLOPT_SSLCERT, getcwd().'ipm.crt');

I suspect you have them the wrong way round.

kayo

I think that you already fixed your problem, but I can see two problems:

  1. you forgot about a slash between getcwd() and filename:
    curl_setopt($ch, CURLOPT_CAINFO, getcwd().'/ipm.crt');
    curl_setopt($ch, CURLOPT_SSLCERT, getcwd().'/ipm.pem');
  2. you need to attach a key file as @donparalias already said

The key must be a filename, not a passphrase.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!