无法使用 PHP OAuth 扩展使用已知 CA 证书对对等证书进行身份验证
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14566864/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Peer certificate cannot be authenticated with known CA certificates using PHP OAuth extension
提问by arelangi
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
我正在使用 PHP OAuth 扩展来调用 Tradeking API。当我在这里进行确切的调用时,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)
捕获异常!响应:请求失败(对等证书无法使用已知 CA 证书进行身份验证)
Why this is happening and how can I resolve this?
为什么会发生这种情况,我该如何解决?
回答by datasage
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.
OAuth 扩展使用 curl 发出请求。默认情况下,CURL 通常会验证 SSL 证书以查看其是否有效并由接受的 CA 颁发。为此,curl 使用一组捆绑的 CA 证书。
You can either disable the SSL checks ($oauth->disableSSLChecks()). Or ensure that you have a current version of curl. More informationon curl certification verification.
您可以禁用 SSL 检查 ( $oauth->disableSSLChecks())。或者确保您拥有当前版本的 curl。有关curl 认证验证的更多信息。
回答by borayeris
The right solution is checking the server TIME. If it is wrong SSL doesn't work fine.
正确的解决方案是检查服务器时间。如果它是错误的 SSL 不能正常工作。

