Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Uncaught exception 'Parse\ParseException' with message 'SSL certificate problem: unable to get local issuer certificate'

This is the first time I use parse.com php SDK and I try to execute the following code

<?php require '../autoload.php'; 
use Parse\ParseObject;
use Parse\ParseClient;
ParseClient::initialize( "Zsr...", "BzM..", "D..." );
$gameScore = new ParseObject("GameScore");
$gameScore->set("score", 1337);
$gameScore->set("playerName", "Sean Plott");
$gameScore->set("cheatMode", false);

try {
        $gameScore->save();
         echo 'New object created with objectId: ' . $gameScore->getObjectId();
        } catch (ParseException $ex) { 
          // Execute any logic that should take place if the save fails.
          // error is a ParseException object with an error code and message.
          echo 'Failed to create new object, with error message: ' + $ex->getMessage();
    }
?>

But I get that error

 Fatal error: Uncaught exception 'Parse\ParseException' with message 'SSL certificate problem: unable to get local issuer certificate' in /opt/lampp/htdocs/parse/src/Parse/ParseClient.php:250 Stack trace: #0 /opt/lampp/htdocs/parse/src/Parse/ParseObject.php(925): Parse\ParseClient::_request('POST', '/1/classes/Game...', NULL, '{"score":1337,"...', false) #1 /opt/lampp/htdocs/parse/src/Parse/ParseObject.php(836): Parse\ParseObject::deepSave(Object(Parse\ParseObject), false) #2 /opt/lampp/htdocs/parse/src/hola.php(11): Parse\ParseObject->save() #3 {main} thrown in /opt/lampp/htdocs/parse/src/Parse/ParseClient.php on line 250

The code it's the tutorial code, iI haven't changed anything anyone knows what's the problem?

like image 779
AFS Avatar asked Jan 05 '15 18:01

AFS


People also ask

How to fix SSL certificate problem unable to get local issuer certificate?

When ssl certificate problem unable to get local issuer certificate error is caused by a self-signed certificate, the fix is to add the certificate to the trusted certificate store. Open the file ca-bundle. crt located in the directory above, then copy and paste the Git SSL certificate to the end of the file.

What does it mean unable to get local issuer certificate?

The error "Unable to get local issuer certificate" is caused by a misconfiguration of the SSL certificate on your machine. An SSL certificate is code on your web server that provides security for online communications. Thus, the error is occurring because the server cannot create a secure connection with your machine.

How do I resolve an SSL certificate in Git bash?

Resolution. The resolution of the “SSL certificate problem” is to add the Git server's Self-Signed SSL certificate or the Root and Certificate Authority (CA) SSL certificates (if the Git server's SSL certificate has been issued by your enterprise) to the trusted certificate store.


1 Answers

I am also getting same issue. Now I resolve using some other forums answer.

Open your ParseClient.php and find:

curl_init();

And after that add line add:

curl_setopt($rest, CURLOPT_SSL_VERIFYPEER, false);

It will work.

like image 194
Hafiz Waleed Hussain Avatar answered Oct 13 '22 06:10

Hafiz Waleed Hussain