Openssl s_Client 在 0.9.8r 中不验证证书

发布于 2024-11-14 06:53:45 字数 371 浏览 10 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

时光礼记 2024-11-21 06:53:45

从 OpenSSL 验证 页面

20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY:无法获取本地
颁发者证书

无法找到颁发者证书:如果颁发者证书会出现这种情况
找不到不受信任的证书的证书。

正如您所猜测的,这意味着 CA 无法加载或验证。这可能是由多种原因引起的,但这里有一个很好的清单。

  • 权限。在 Linux 上尝试 sudo。在 Windows 上尝试“以管理员身份运行”。
  • 尝试对两个版本使用 verify 命令,看看是否出现相同的错误。

    openssl verify -CAfile cacert.pem -CApath ./

  • 丢失/放错位置的文件。自运行以来,该文件夹中的某些内容可能已发生更改。

  • 小路。尝试从从 OpenSSL 0.9.8e-fips-rhel5 运行命令时所在的同一目录运行该命令。

From the OpenSSL Verify page

20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local
issuer certificate

the issuer certificate could not be found: this occurs if the issuer
certificate of an untrusted certificate cannot be found.

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.

  • Permissions. On Linux try sudo. On Windows try "Run as Administrator".
  • 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.

  • Path. Try running the command from the same directory you were in when you ran the command from OpenSSL 0.9.8e-fips-rhel5.
无戏配角 2024-11-21 06:53:45

这个更接近于错误而不是功能,但只要我们记录它,它就是一个功能;-)

c_rehash /etc/ssl/certs

This one is closer to a bug than a feature, but it's a feature so long as we document it ;-)

c_rehash /etc/ssl/certs
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文