Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Peer certificate cannot be authenticated with known CA certificates using PHP OAuth extension

I'm using PHP OAuth extension to make a call to the Tradeking API. When I make the exact call as in here, https://developers.tradeking.com/documentation/php

I'm getting the exception

Exception caught! Response: making the request failed (Peer certificate cannot be authenticated with known CA certificates)

Why this is happening and how can I resolve this?

like image 481
arelangi Avatar asked Jan 28 '13 16:01

arelangi


2 Answers

The OAuth extension uses curl to make the request. By default CURL will generally verify the SSL certificate to see if its valid an issued by an accepted CA. To do this, curl uses a bundled set of CA certificates.

You can either disable the SSL checks ($oauth->disableSSLChecks()). Or ensure that you have a current version of curl. More information on curl certification verification.

like image 108
datasage Avatar answered Oct 25 '22 14:10

datasage


The right solution is checking the server TIME. If it is wrong SSL doesn't work fine.

like image 24
borayeris Avatar answered Oct 25 '22 12:10

borayeris