1

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.

user4826347
  • 783
  • 2
  • 11
  • 29
  • Maybe this link will help: `https://stackoverflow.com/questions/24620393/aws-ssl-security-error-curl-60-ssl-certificate-prob-unable-to-get-local` – J. Garth Jul 29 '17 at 22:15

1 Answers1

1

J.Garth's note helped me solve the issue. Thanks

Stackoverflow suggestion by J Garth

user4826347
  • 783
  • 2
  • 11
  • 29