【问题标题】:Is there a way to check if the SSL digital certificate is valid without installing on the web server?有没有办法在不安装在网络服务器上的情况下检查 SSL 数字证书是否有效?
【发布时间】:2013-10-06 01:06:32
【问题描述】:

是否有任何工具或机制可以帮助验证 CA 颁发的 SSL 证书,然后再将其安装到目标 Web 服务器上?

【问题讨论】:

    标签: ssl https digital-certificate ca


    【解决方案1】:

    是的,您可以使用 openssl 通过 s_server 命令为您的证书创建一个测试服务器。这将创建一个最小的 SSL/TLS 服务器来响应端口 8080 上的 HTTP 请求:

    openssl s_server -accept 8080 -www -cert yourcert.pem -key yourcert.key -CAfile chain.pem
    

    yourcert.pem 是 X.509 证书,yourcert.key 是您的私钥,chain.pem 包含您的证书和根证书之间的信任链。你的 CA 应该给你 yourcert.pem 和 chain.pem。

    然后使用openssl的s_client进行连接:

    openssl s_client -connect localhost:8080 -showcerts -CAfile rootca.pem
    

    或在 Linux 上:

    openssl s_client -connect localhost:8080 -showcerts -CApath /etc/ssl/certs
    

    注意:该命令不会验证主机名是否与证书的 CN(通用名称)或 SAN(subjectAltName)匹配。 OpenSSL 还没有该任务的例程。它将在 OpenSSL 1.1 中添加。

    【讨论】:

      【解决方案2】:

      验证 CA 颁发的 SSL 的最佳和最简单的方法是对其进行解码。

      这是一个有用的链接,可以帮助您做到这一点:http://www.sslshopper.com/csr-decoder.html

      希望这会有所帮助!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-09-03
        • 1970-01-01
        • 2010-09-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-04-25
        • 1970-01-01
        相关资源
        最近更新 更多