Kashif Ali Kashif Ali - 6 months ago 40
PHP Question

AWS HTTP error: cURL error 60: Peer certificate cannot be authenticated with gi certificates

i am using this package

https://github.com/Vinelab/cdn


for laravel CDN asset management
after configring all the package when i execute this command to push assets to s3 bucket

php artisan cdn:push


its show me error


\Exception\S3Exception] executing "ListObjects" on
"https://s3.eu-central1.amazonaws.com/moberries-assets?encode=url";
AWS HTTP error: cURL error 60: Peer certificate cannot be
authenticated with gi certificates

Http\Exception\RequestException] ror 60: Peer certificate cannot be
authenticated with given CA certificates

Http\Ring\Exception\RingException] ror 60: Peer certificate cannot be
authenticated with given CA certificates


i vitist the followign links for this issue and also include the cancert certificate in the project file.

when i run the command it always shown the above mentioned error

i consult the following links

enter link description here

Please if one has its solution for laravel project then reply fast.Thanks

Answer

This error occur because the package not load the cacert.pen certificate file from their config/cdn.php while connecting to the server so, server always reject the request and give authentication error

solution:

Add cacert.pen certificate file in public directory of your project

And add the following code to AwsS3Provider.php package file

File path is

\xampp\htdocs\yourproject\vendor\vinelab\cdn\src\Vinelab\Cdn\Providers\AwsS3Provider.php on line 161 below the region code

'http' => ['verify' => public_path().'/cacert.pem',],
Comments