curl 错误 60,SSL 证书问题:证书链中的自签名证书
我尝试将 curl 请求与我正确的APP_ID、APP_SECRET等发送到
https://oauth.vk.com/access_token?client_id=APP_ID&client_secret=APP_SECRET&code=7a6fa4dff77a228eeda56603b8f53806c883f011c40b72630bb50df056f6479e52a&redirect_uri=REDIRECT_URI
我需要从中获取access_token,但要获得一个 FALSE 并打印下一条消息,否则:curl_error()
60: SSL certificate problem: self signed certificate in certificate chain
我的代码是:
// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, $url);
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);
if ( ! $output) {
print curl_errno($ch) .': '. curl_error($ch);
}
// close curl resource to free up system resources
curl_close($ch);
return $output;
当我手动移动到上面的链接时,我得到了access_token。为什么它不适用于卷曲?请帮忙。