1

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 in RequestException.php line 51:
cURL error 60: SSL certificate problem: unable to get local issuer certificate

Smern
  • 18,066
  • 21
  • 67
  • 87
Rashed Shaon
  • 338
  • 1
  • 4
  • 17

2 Answers2

2

I think you have a certificate problem. It seems Goutte depends on Guzzle 4. And Guzzle can't find the proper certificate to verify a secure https request, see more about it here.

Try to download this file: Bundle of CA Root Certificates . (Open and Save As).

Then locate your php.ini file and add,or edit if it already exists, this line

curl.cainfo = "[pathtothisfile]\cacert.pem"

Harry Geo
  • 1,163
  • 3
  • 10
  • 23
2

Try disabling CURLOPT_SSL_VERIFYPEER to stop cURL from verifying the peer's certificate:

$client->getClient()
       ->setDefaultOption('config/curl/' . CURLOPT_SSL_VERIFYPEER, false);
Bogdan
  • 41,021
  • 10
  • 123
  • 126
  • `RuntimeException in Client.php line 289: no api namespace found: getClient` This error is showing after using `$nexmo = app('Nexmo\Client'); $nexmo->getClient()->setDefaultOption('config/curl/' . CURLOPT_SSL_VERIFYPEER, false); $nexmo->message()->send([ 'to' => ''.$mobile.'', 'from' => '918269871472', 'text' => ''.$message.'', ]);` this code. @Bogdan – Giridhari Lal May 07 '17 at 18:59