Openssl s_Client 在 0.9.8r 中不验证证书
我正在使用 openssl v0.9.8r 并且尝试运行此命令(在我运行的目录中 CA 文件名为 cacert.pem)
openssl s_client -CAfile cacert.pem -CApath ./ -connect mail .google.com:443
验证失败,如下
验证返回代码:20(无法获取本地颁发者证书)
但是,当我在旧版本之一上尝试相同的命令时,即OpenSSL 0.9.8e-fips-rhel5 它按预期成功。我在这里错过了什么吗?我非常感谢我能得到的任何帮助,因为我已经被 openssl 问题困扰了一段时间了。预先非常感谢。
问候
哈里
I am using openssl v0.9.8r and I tried running this command (with the CA file name as cacert.pem in the directory in which I was running)
openssl s_client -CAfile cacert.pem -CApath ./ -connect mail.google.com:443
And the verification failed as follows
Verify return code: 20 (unable to get local issuer certificate)
However when I tried the same command on one of the older versions namely OpenSSL 0.9.8e-fips-rhel5 it succeeded as expected. Am I missing something here? I would greatly appreciate any help I can get as I have been stuck with openssl issues for a while now. Thanks a lot in advance.
Regards
Hari
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从 OpenSSL 验证 页面
正如您所猜测的,这意味着 CA 无法加载或验证。这可能是由多种原因引起的,但这里有一个很好的清单。
尝试对两个版本使用 verify 命令,看看是否出现相同的错误。
openssl verify -CAfile cacert.pem -CApath ./
丢失/放错位置的文件。自运行以来,该文件夹中的某些内容可能已发生更改。
From the OpenSSL Verify page
As you can guess, this means the CA failed to load or validate. This can be caused by any number of reason, but here's a good checklist.
Try using the verify command with both versions and see if you get the same error.
openssl verify -CAfile cacert.pem -CApath ./
Missing/misplaced files. Something might have changed in that folder since you were running.
这个更接近于错误而不是功能,但只要我们记录它,它就是一个功能;-)
This one is closer to a bug than a feature, but it's a feature so long as we document it ;-)