4

我一直在尝试使用 OpenID,并设置了一个示例网页以使用我的 OpenID 帐户进行访问。我正在使用Janrain 的 Php OpenID 库,但它不适用于我的 Google 帐户。一项小小的研究让我想到了这个问题,这表明问题在于谷歌使用https和......

... 发出 HTTPS 请求的设置很可能在您的 PHP 服务器上被破坏了。检查以确保您已安装 ca-certificates 软件包。

在同一个线程中,有人链接到我部署并成功与我的 Google 帐户一起使用的库的黑客版本。其他问题有其他自定义来解决类似问题(Janrain 的 PHP-OpenID 和 Google/Yahoophp-openID 不适用于 Yahoo!,在 PHP OpenID 中使用 AX 的示例... )

我对安全性不太感兴趣,所以我问;有人知道不使用这些黑客版本的理由吗?

原始库是否有这些黑客通过设计修复的任何缺点,因此黑客是一个潜在的安全漏洞?

有没有一个合格的加密货币专家看过这些解决方案并走了“大卫乔姆的胡子!不!

如果是这样 - 因此我不应该使用任何这些黑客 - 我将如何检查我是否“安装了 ca-certificates 包”?

4

3 回答 3

6

以下是其中一个“被黑”版本的作者写道:

In particular CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST are true by default: I set them to false and it worked for the test page!

The effect that has is to pretty much negate any security advantage offered by using HTTPS. The primary reason HTTPS is useful in OpenID is that it guards against a man-in-the-middle attack, i.e. some bad guy poisons your DNS cache to send all google.com requests to bad-guys.example. With properly configured HTTPS, you'd verify the certificate on the connection, find out it wasn't from Google, and say "I'm not going to believe anything you say, bad-guys!"

Unless, of course, you don't verify any certificates (you set all the SSL_VERIFY options to false), in which case your server will believe everything bad-guys says as if it were the real Google provider. You can imagine how that might be bad.

Now, frankly, this isn't the worst choice you could make, because it's no worse than just using HTTP, which a lot of people do anyway. You're just lying to your users if you imply that you're providing HTTPS-level security when you're not.

And there's a lot of information out there about how easy it is or isn't to do a dns-based attack, or how easy it is to forge SSL certificates. Either way, it does require someone to attack the connection between your server and Google, which is generally harder than attacking the connection between the user's laptop in the coffee shop and your server.

But still, much better to actually fix your PHP or CURL SSL configuration. Or if you don't, warn your users of that when they sign up with HTTPS identifiers, so they can choose if they really want to use that OpenID with your site.

Which leads to your second question. I think, not knowing anything about which server platform you're using, the best thing I can do is to link you to the Curl docs on SSL certificates; see the section that says "Get a better/different/newer CA cert bundle!"

于 2010-06-19T16:39:03.650 回答
0

From the Wikipedia article on Certificate Authority:

A CA issues digital certificates that contain a public key and the identity of the owner. When an end-user tries to access an unknown URL, the web browser (e.g. Mozilla Firefox and Microsoft Internet Explorer) will contact the CA to confirm the public key of the URL.

... so the CA Certificate is a Public Key Certificate used to communicate over https://. Your server should have CA Certificates on the file system somewhere. If not, you'll have to download the CA Certificate yourself and set the CURLOPT_CAINFO constant to point to its location. See this article.

http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/

于 2010-06-21T19:53:51.283 回答
-1

[...] 有谁知道不使用这些黑客版本的原因?

除了它们是被黑客入侵的版本之外,这些版本很可能没有记录并且无法保证它们的行为?

我无法具体回答,但是当您使用已应用快速修复和变通方法的模块时,应该有一些警告灯闪烁,尤其是在您处理授权和安全问题时。我认为最好的建议是“使用风险自负!”

我敢肯定,对该主题有更多了解的人会尽快提供更明智的答案。

于 2010-06-15T18:02:18.203 回答