AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 747525
Accepted
jouell
jouell
Asked: 2016-01-08 16:42:34 +0800 CST2016-01-08 16:42:34 +0800 CST 2016-01-08 16:42:34 +0800 CST

在 openssl 输出中验证 return:1 是什么意思

  • 772

我不明白 openssl 输出。运行openssl如下:

#openssl s_client -connect google.com:443 -CAfile cacert.pem < /dev/null

最终一切都很好,最终实体的证书被验证OK: Verify return code: 0 (ok)

但是return:1对于下面的中间体,在输出开头的验证呢?这是什么意思或意义何在?

depth=3 C = US, O = Equifax, OU = Equifax 安全证书颁发机构验证返回:1
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA 验证返回:1
depth=1 C = US, O = Google Inc, CN = Google Internet Authority G2 验证返回:1
depth=0 C = US, ST = California, L = Mountain View, O = Google Inc, CN = google.com 验证返回:1

---
证书链
 0 秒:/C=US/ST=加利福尼亚/L=山景/O=Google Inc/CN=google.com
   i:/C=US/O=Google Inc/CN=Google Internet Authority G2
 1 s:/C=US/O=Google Inc/CN=Google Internet Authority G2
   i:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
 2 s:/C=US/O=GeoTrust Inc./CN=GeoTrust Global CA
   i:/C=US/O=Equifax/OU=Equifax 安全证书颁发机构
---


openssl
  • 1 1 个回答
  • 20820 Views

1 个回答

  • Voted
  1. Best Answer
    David Schwartz
    2016-01-09T00:28:56+08:002016-01-09T00:28:56+08:00

    验证回调函数(用于对特定用途的证书的适用性进行最终验证)由 SSL 传递一个称为字段的字段,该preverify_okay字段指示证书链是否通过了适用于所有情况的基本检查。A1表示这些检查通过。

    int verify_callback(int preverify_ok, X509_STORE_CTX *x509_ctx)
    

    verify_callback 函数用于控制设置 SSL_VERIFY_PEER 标志时的行为。它必须由应用程序提供并接收两个参数:preverify_ok 指示是否通过了相关证书的验证(preverify_ok=1)或未通过(preverify_ok=0)。

    这就是所verify return:1显示的。

    如果您想了解更多详细信息,可以查看代码:

    int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx)
        {
        [ snip ]
        BIO_printf(bio_err,"verify return:%d\n",ok);
        return(ok);
        }
    
    • 20

相关问题

  • 如何在 Mac OS X 服务器上安装替换 SSL 证书?

  • 在 LAMPP 中升级单个库(特别是 openssl)

  • 带有基于商业 CA 的客户端证书的 ssl_error_handshake_failure_alert

  • 我可以对 *.domain.com 和 domain.com 使用相同的通配符认证吗

  • 为 apache 生成自签名 SSL 证书

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve