x

SSL certificate problem: unable to get local issuer certificate

Hi,

I am using Localhost for configuration.

i am having issue while making transaction.

"SSL certificate problem: unable to get local issuer certificate"

SquareConnect\ApiException Object
(
    [responseBody:protected] => 
    [responseHeaders:protected] => 
    [responseObject:protected] => 
    [message:protected] => API call to https://connect.squareup.com/v2/locations/CBASEK8mmvqJBGz6ugnDBxHekt4gAQ/transactions failed: SSL certificate problem: unable to get local issuer certificate
    [string:Exception:private] => 

 Can you please help?

how can i resolve this issue?

3,079 Views
Message 1 of 8
Report
7 REPLIES 7

I'm not expert at the API (Just got started this week) but I ran into the same issue and used the following to resolve locally:

 

 

SquareConnect\Configuration::getDefaultConfiguration()->setSSLVerification(FALSE);

 

3,012 Views
Message 2 of 8
Report
Beta Member

where do you change this part of code at?

1,750 Views
Message 3 of 8
Report
Square Community Moderator

Hey @daryltan - Not too sure where you can add the code the Sellers are referring to in this thread. Is your SSL on your site not working? If you still need help, can you please provide us with more details? 

 

Thank you. 

Sayra
Community Moderator, Square // Moderadora de la Comunidad, Square
Sign in and click Mark as Best Answer if my reply answers your question.
Inicie seción y haga clic en Marcar como "Mejor Respuesta" si mi respuesta contesta su pregunta.
1,732 Views
Message 4 of 8
Report
Beta Member

When I placed my index.php file under wamp64/www/square-php-sdk and tried to launch it with localhost, I am getting the error "Recieved error while calling Square: SSL certificate problem: unable to get local issuer certificate"

1,730 Views
Message 5 of 8
Report

Here is how I overcame it (make sure to comment this out as a reminder in production)
 
Look for: 
// Create and configure a new API client object
$defaultApiConfig = new \SquareConnect\Configuration();
$defaultApiConfig->setAccessToken($authzToken);
 
Add this right after setAccessToken:
//localhost testing override ssl
$defaultApiConfig->setSSLVerification(FALSE);
2,452 Views
Message 6 of 8
Report

How to do it on new API with 

SquareClient()

1,261 Views
Message 7 of 8
Report
Square Community Moderator

Hi @standa,

 

Thanks for writing in and welcome to our Seller Community 👋

 

Our API support team would be the best point of contact here - reach out via this form when you get a chance. Please let us know how you go!

1,196 Views
Message 8 of 8
Report