aws s3 Exception -Error executing PutObject -Laravel

Published

Error executing "PutObject" on "https://s3.us-east-2.amazonaws.com/profile_pictures/61e15d8706062-1642159495/cartnotification.PNG"; AWS HTTP error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://s3.us-east-2.amazonaws.com/profile_pictures/61e15d8706062-1642159495/cartnotification.PNG

Am getting the above error when trying to upload a file to s3 from my local.I tried clearing cache. I’ve already gone through many google links.But couldn’t solve the issue.How can i fix this?

controller

$file->storeAs("profile_pictures/{$folder}",$fileName,config('constant.disk'));

constant.php

return [
    'disk'=>env('DRIVER','s3')
];

filsystems.php

'disks' => ['s3' => ['driver' => 's3',
                    'key' => env('AWS_ACCESS_KEY_ID'),
                    'secret' => env('AWS_SECRET_ACCESS_KEY'),
                    'region' => env('AWS_DEFAULT_REGION'),
                    'bucket' => env('AWS_BUCKET'),
                    'url' => env('AWS_URL'),
                    'endpoint' => env('AWS_ENDPOINT'),
                    'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
                    'visibility'=>'public'],
           ]

projectvendorleagueflysystem-aws-s3-v3srcAwsS3Adapter.php

public function setVisibility($path, $visibility)
    {
        $command = $this->s3Client->getCommand(
            'putObjectAcl',
            [
                'Bucket' => $this->bucket,
                'Key'    => $this->applyPathPrefix($path),
                'ACL'    => $visibility === AdapterInterface::VISIBILITY_PUBLIC ? 'public-read' : 'private',
            ]
        );
   }

Bucket Policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Statement1",
            "Principal": {},
            "Effect": "Allow",
            "Action": [],
            "Resource": []
        }
    ]
}

Source: Laravel

Published
Categorised as amazon-s3, amazon-web-services, laravel, laravel-8, php Tagged , , , ,

Answers

Leave a Reply

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq