Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon S3 on wamp localhost SSL error

I'm trying to test in PHP Amazon S3 on my localhost but keep getting the same error:

Fatal error: Uncaught exception 'cURL_Exception' with message 'cURL resource: Resource id #69; cURL error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed (cURL error code 60). See http://curl.haxx.se/libcurl/c/libcurl-errors.html for an explanation of error codes.' in C:\wamp\www\mysite\application\libraries\awsphp\lib\requestcore\requestcore.class.php:829 Stack trace: #0 C:\wamp\www\mysite\application\libraries\awsphp\sdk.class.php(1034): RequestCore->send_request() #1 C:\wamp\www\mysite\application\libraries\awsphp\services\sqs.class.php(250): CFRuntime->authenticate('ListQueues', Array) #2 C:\wamp\www\mysite\application\libraries\awsphp\services\sqs.class.php(582): AmazonSQS->authenticate('ListQueues', Array) #3 C:\wamp\www\mysite\application\controllers\uploads.php(33): AmazonSQS->list_queues() #4 [internal function]: Uploads->aw3() #5 C:\wamp\www\mysite\system\core\CodeIgniter.php(359): call_user_func in C:\wamp\www\mysite\application\libraries\awsphp\lib\requestcore\requestcore.class.php on line 829

Test code:

$sqs = new AmazonSQS();
$response = $sqs->list_queues();
var_dump($response->isOK());

I properly installed the AWS SDK to php files and enabled CURL and SSL on me local server. What can I do to make this work? I can't find any help online. I'm using wamp.

like image 871
CyberJunkie Avatar asked Aug 11 '12 00:08

CyberJunkie


People also ask

Can you use HTTPS with S3?

If your Amazon S3 bucket is configured as a website endpoint, you can't configure CloudFront to use HTTPS to communicate with your origin because Amazon S3 doesn't support HTTPS connections in that configuration.


1 Answers

  1. Get this file and save it to your hard drive. Call it cacert.pem.
  2. Configure curl.cainfo in php.ini with the full path to the file downloaded in step 1.
  3. Restart Apache.

I'll leave it as an exercise for the reader to find out why this fixes it, all the information you need can be found in the links above.

like image 158
DaveRandom Avatar answered Sep 21 '22 14:09

DaveRandom