skip to Main Content

I am using Guzzle 7.2 in my Laravel app. When Laravel Filemanager makes request towards Dropbox it uses Guzzle. The problem I face is that I get cURL error 60: SSL certificate problem, I have found out that Guzzle throws this error since I am hosting my app on localhost (artisan serve) and it can’t validate ssl. I would like to make all Guzzle requests not to require ssl verification.

I have found out that Guzzle 4.0 doesn’t require ssl verification and it doesn’t throw this error. The problem is that I can’t define Guzzle 4.0 in composer.json since my other packages require higher version of Guzzle. I have also found this solution to make Guzzle request ignore the ssl verifiction

use GuzzleHttpClient;

$client = new Client(['verify' => false]);

$response = $client->get('https://example.com/');

Problem with this solution is that Filemanager makes this request and I have no idea where this request is being made, I can’t find that specifc part of code where I could define 'verify' => false. I think the easiest solution would be make all Guzzle requests with 'verify' => false, make this as "global definition".

I understand all the risks of ignoring ssl, but since I am on localhost this solution would definitely work for me.

I searched the internet, but couldn’t find solution that involves Laravel file manager and disabling Guzzle ssl verification.

Regards

2

Answers


  1. Chosen as BEST ANSWER

    I have actually found a php.ini file that artisan serve uses by using phpinfo(). Then I downloaded cert.pem and defined its location in the php.ini and Guzzle was able to verify request.


  2. you can use this if your project in testing

    but ssl is more secure

    $response = $client->withoutVerifying()->get('https://example.com/');
    

    hopefully that is help you

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search