Reputation: 783
I am trying to generate an xml on the fly using XMLDocument and add to a folder in the AWS S3 bucket
public static function putXML_To_Bucket($bucket, $dom, $location) {
$rest = new S3Request('PUT', $bucket, $location);
$rest->data = $dom->saveXML();
$rest->size = strlen($rest->data);
$rest->setHeader('Content-Type', 'application/xml');
$rest = $rest->getResponse();
var_dump($rest);
if ($rest->error === false && $rest->code !== 200)
$rest->error = array('code' => $rest->code, 'message' => 'Unexpected HTTP status');
if ($rest->error !== false) {
trigger_error(sprintf("S3::putBucket({$bucket}, {$acl}, {$location}): [%s] %s",
$rest->error['code'], $rest->error['message']), E_USER_WARNING);
return false;
}
return true;
}
The var_dump($rest) produces this error
object(stdClass)#9 (1) {
["error"]=>
array(3) {
["code"]=>
int(60)
["message"]=>
string(63) "SSL certificate problem: unable to get local issuer certificate"
["resource"]=>
string(34) "/mybucket/"
}
}
Note I am developing from localhost.
I don't have a clue why this is happening. Any help would be much appreciated.
Upvotes: 1
Views: 276
Reputation: 783
J.Garth's note helped me solve the issue. Thanks
Stackoverflow suggestion by J Garth
Upvotes: 1