I thought I'd write up the following issue to help anyone who encounters it too.
While trying to get the package up and running on my local machine, on calling the put() method, the following exception was being thrown:
GuzzleHttp\Exception\RequestException with message 'cURL error 60: SSL certificate problem: Invalid certificate chain (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)'
To work around the exception, in DropboxServiceProvider, I simply instantiated and passed through my own GuzzleHttp\Client dependency with verify request option set to false:
<?php
namespace App\Providers;
use Storage;
use GuzzleHttp\Client as GuzzleClient;
use League\Flysystem\Filesystem;
use Spatie\Dropbox\Client as DropboxClient;
use Illuminate\Support\ServiceProvider;
use Spatie\FlysystemDropbox\DropboxAdapter;
class DropboxServiceProvider extends ServiceProvider
{
/**
* Perform post-registration booting of services.
*/
public function boot()
{
Storage::extend('dropbox', function ($app, $config) {
$accessToken = $config['accessToken'];
$guzzleClient = new GuzzleClient([
'headers' => [
'Authorization' => "Bearer {$accessToken}",
],
'verify' => false,
]);
$client = new DropboxClient($accessToken, $guzzleClient);
return new Filesystem(new DropboxAdapter($client));
});
}
/**
* Register bindings in the container.
*/
public function register() {}
}
Note:Guzzle's documentation mentions disabling certificate verification (setting the verify request option to false) is insecure, and thus, should probably be used with caution.
Hope this information helps someone else down the track.
Hi! 👋
As always, another wonderful package from Spatie.
I thought I'd write up the following issue to help anyone who encounters it too.
While trying to get the package up and running on my local machine, on calling the
put()
method, the following exception was being thrown:To work around the exception, in
DropboxServiceProvider
, I simply instantiated and passed through my ownGuzzleHttp\Client
dependency withverify
request option set tofalse
:Note: Guzzle's documentation mentions disabling certificate verification (setting the
verify
request option tofalse
) is insecure, and thus, should probably be used with caution.Hope this information helps someone else down the track.
Cheers!