c - 打开SSL : error "self signed certificate in certificate chain"

标签 c linux openssl ssl-certificate verify

当我使用 openssl API 验证服务器证书(自签名)时,出现以下错误:

error 19 at 1 depth lookup:self signed certificate in certificate chain

根据 openssl documentation , 这个错误 (19) 是

"X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN: self signed certificate in certificate chain - the certificate chain could be built up using the untrusted certificates but the root could not be found locally."

为什么会出现这个错误?我的服务器证书有问题吗?

最佳答案

您有一个自签名的证书,因此默认情况下它是不受信任的,这就是 OpenSSL 提示的原因。这个警告实际上是一件好事,因为这种情况也可能由于 man-in-the-middle attack 而上升。 .

要解决这个问题,您需要将其安装为受信任的服务器。如果它是由不受信任的 CA 签名的,您还必须安装该 CA 的证书。

看看this link关于安装自签名证书。

关于c - 打开SSL : error "self signed certificate in certificate chain",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12180552/

相关文章:

c++ - 将包含十六进制值的字符串转换为c中的字符字节

C - 用户输入矩阵

linux - 使用 grep 命令按首字母、@ 和 "."进行过滤

linux - 在 Linux 上模拟延迟和丢弃的数据包

c - 查找子字符串,但不是所有输入?

c - 使用hiredis一次调用发送多条记录

linux - 如何在 Ubuntu Linux 上安装共享库?

openssl - 使用OpenSSL创建CSR会挂起

python - python请求中的OpenSSL错误

linux - 与 gcc -lnetsnmp 链接时 undefined reference