linux - RedHat Linux 8 中的 openssl 证书验证失败

标签 linux openssl

对于相同的 cacert.pem openssl 返回不同的结果。

证书在Redhat linux 8中校验失败,在Redhat linux 7.5中校验成功

[rhel8]: openssl verify cacert.pem
C = NO, L = Asker, O = E1, OU = ETO TER, CN = ETO Opto Certificate Authority
error 18 at 0 depth lookup: self signed certificate
error cacert.pem: verification failed

RHEL 7.5:

[rhel7.5]: openssl verify cacert.pem
ca-certs.pem: C = NO, L = Asker, O = E1, OU = ETO TER, CN = ETO Opto Certificate Authority
error 18 at 0 depth lookup:self signed certificate
OK

最佳答案

在您的情况下(自签名证书),openssl 的 2 个版本不会返回相同的代码。

  • OpenSSL 1.0.2 返回 0
  • OpenSSL 1.1.1 返回 2

这记录在变更日志中:

Changes between 1.0.2h and 1.1.0 [25 Aug 2016]

[...]

*) Make openssl verify return errors.

您的版本 1.0.2k 在分支 1.0.2 上,其行为与 1.0.2h 中的一样。

关于linux - RedHat Linux 8 中的 openssl 证书验证失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56753484/

相关文章:

c++ - 取消引用映射内存时出现段错误

linux - 在 cURL 命令中用变量替换字符串

c - 在 PKCS#12 结构中管理多个 RSA key /证书

java - SSL 问题 : alert number 46 (sslv3 alert certificate unknown)

linux - Nagios - 错误 : Could not read object configuration data

xml - 如何搜索xml文件,条件是文件名在文件内

python + linux + 不终止子进程问题

ruby - 使用 RVM 在 mac os 10.15.5 Catalina 中安装 Ruby 2.3.7 时出错;未找到 OpenSSL

使用 OpenSSL ssl_conn 错误进行编译

c# - 使用带有现有 key 的 OpenSSL.NET 解密 RSA