如何解决cURL错误60:Laravel 5中的SSL证书? [英] How solve cURL error 60: SSL certificate in Laravel 5?
问题描述
我正在使用"FriendsOfPHP/Goutte"包 https://github.com/FriendsOfPHP/Goutte
对于网络爬网...当我使用"http://"链接时,它运行正确,但是当我使用"https://"时,则显示以下错误...
I'm using "FriendsOfPHP/Goutte" Package https://github.com/FriendsOfPHP/Goutte
For web crawling... When I use "http://" links then it's ran correctly but when I use "https://" then show the following errors...
2/2 RequestException.php第51行中的RequestException:
cURL错误60:SSL证书问题:无法获取本地颁发者证书
2/2 RequestException in RequestException.php line 51:
cURL error 60: SSL certificate problem: unable to get local issuer certificate
推荐答案
尝试禁用CURLOPT_SSL_VERIFYPEER
以阻止cURL验证对等方的证书:
Try disabling CURLOPT_SSL_VERIFYPEER
to stop cURL from verifying the peer's certificate:
$client->getClient()
->setDefaultOption('config/curl/' . CURLOPT_SSL_VERIFYPEER, false);
这篇关于如何解决cURL错误60:Laravel 5中的SSL证书?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!