Skip to content

[requestException] cURL error 60: SSL certificate problem: unable to get local issuer certificate #348

Answered by rajakhoury
GabMic asked this question in Q&A
Discussion options

You must be logged in to vote

here one way to do it. Extend the Crawler class and override the GuzzleHttp Client options.

e.g

MyCrawler::create()
	->setCrawlObserver(new CrawlObserver())
	->startCrawling('https://domain.com');

Then in MyCrawler do this:

use GuzzleHttp\RequestOptions;
use Spatie\Crawler\Crawler as BaseCrawler;
 
class MyCrawler extends BaseCrawler
{
	protected static array $defaultClientOptions = [
		RequestOptions::COOKIES => true,
		RequestOptions::CONNECT_TIMEOUT => 10,
		RequestOptions::TIMEOUT => 10,
		RequestOptions::ALLOW_REDIRECTS => false,
		RequestOptions::HEADERS => [
			'User-Agent' => self::DEFAULT_USER_AGENT,
		],
		'verify' => false // This is what you need to add  
	];
}

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@rajakhoury
Comment options

@devHarandi
Comment options

Answer selected by freekmurze
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #347 on February 05, 2021 07:46.