dtxpz8785 2015-10-08 13:34
浏览 76

卷曲错误(60)SSL证书:无法获得本地颁发者证书

I would like to connect to some API by SSL.

Already I have generated 5 files:

PROD.cert.pem
PROD.issuer.pem
PROD.chain.pem
PROD.csr
PROD.key

This is my php code:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,           $wsdl);
curl_setopt($ch, CURLOPT_SSLCERT,       getcwd() . '\PROD.cert.pem');
curl_setopt($ch, CURLOPT_SSLKEY, getcwd() . '\PROD.key');

$output = curl_exec($ch);

var_dump(curl_errno($ch));
var_dump(curl_error($ch));

So, as you can see I add two files: cert and key

When, I run this code I always got error:

SSL certificate problem: unable to get local issuer certificate

Do you know, what I do wrong? How can I resolve this error?

  • 写回答

1条回答 默认 最新

  • doulin3510 2015-10-08 16:34
    关注

    Certificates are not be included in your webdir, you need to install them on your webserver. You can find a comprehensive guide here

    评论

报告相同问题?

悬赏问题

  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用