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

China☆狼群 提交于 2019-12-21 12:06:54

问题


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?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/14566864/peer-certificate-cannot-be-authenticated-with-known-ca-certificates-using-php-oa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!