SSL certificate problem: unable to get local issuer certificate 的解决方法

今天在进行微信开发获取微信Access_Token时,使用到了php的curl库,

在敲完代码后获取token失败,经过各种排查错误,到了下面这一步

SSL certificate problem: unable to get local issuer certificate

后来通过下面解决,在php代码中输入下面一段

curl_setopt_array(
$ch,
array(
CURLOPT_URL => $url,
CURLOPT_REFERER => $url,
CURLOPT_AUTOREFERER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_CONNECTTIMEOUT => 1,
CURLOPT_TIMEOUT => 30,
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36',
)
);

时间有限先大概这样说明下。

posted @ 2017-06-21 18:07  Silenced丶H  阅读(8340)  评论(4编辑  收藏  举报