无法使用CURL获得本地发行者证书 [英] Unable to get local issuer certificate using CURL

查看:52
本文介绍了无法使用CURL获得本地发行者证书的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用https url调用CURL时出现以下错误:

I'm getting the following error when call the CURL with https url:

"SSL证书问题:无法获取本地颁发者证书"

"SSL certificate problem: unable to get local issuer certificate"

    $ch = curl_init($sendurl);                                                                                                                                     
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);  

    curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) .'/cert/uat.abc.pem');

    echo $result = curl_exec($ch);
    echo curl_error($ch);

有人知道如何设置吗?

推荐答案

我认为您可以设置CURLOPT_SSLCERT选项对其进行修复,或使用curl_setopt($ ch,CURLOPT_SSL_VERIFYHOST,1)和curl_setopt($ ch,CURLOPT_SSL_VERIFYPEER,false)忽略这种变暖

I think you can set CURLOPT_SSLCERT option to fix it,or use curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1) and curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false) to ignore this warming

这篇关于无法使用CURL获得本地发行者证书的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆