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 / 问题 / 642464
Accepted
dotancohen
dotancohen
Asked: 2014-11-07 03:12:02 +0800 CST2014-11-07 03:12:02 +0800 CST 2014-11-07 03:12:02 +0800 CST

确定 SSL 证书是否受 SHA-1 淘汰的影响

  • 772

在以下情况下,谷歌浏览器会开始警告用户他们的 SSL 连接不安全:

  1. 证书使用 SHA1 哈希算法,并且
  2. 证书在 2016-01-01 (或 2017-01-01 不同来源)或之后到期

因此,我正在尝试编写一种方法来确定证书是否受到影响。这是我维护的另一台服务器上的 SHA1 证书的示例,该证书在“安全”时间范围内到期:

$ curl -v --silent https://example.com/ 2>&1 | grep "expire\|SSL connection using"
* SSL connection using DHE-RSA-AES256-GCM-SHA384
*        expire date: 2015-07-20 00:00:00 GMT

我怎么能确定这个证书是字符串中的 SHA1 DHE-RSA-AES256-GCM-SHA384?字符串中的内容确保它256看起来像是使用 256 位算法,尽管我知道这不是因为我自己使用$ openssl req -new -newkey rsa:2048 -nodes. 谷歌搜索我找到了这个资源或支持的密码,但我不知道如何从该文档中确定密码强度。

如何通过 curl 确定密码强度,以便编写脚本?

apache-2.2
  • 2 2 个回答
  • 1706 Views

2 个回答

  • Voted
  1. Best Answer
    Steffen Ullrich
    2014-11-07T03:25:15+08:002014-11-07T03:25:15+08:00

    我怎么能确定这个证书是来自字符串 DHE-RSA-AES256-GCM-SHA384 的 SHA1

    你不能。此字符串仅描述用于加密的密码套件,并且独立于证书本身。您必须改为查看证书,如下所示:

    openssl s_client -connect example.com:443 | \
    openssl x509 -text -noout |\
    grep 'Signature Algorithm\|Not After'
    
    • 2
  2. mavit
    2015-06-24T11:09:53+08:002015-06-24T11:09:53+08:00

    请注意,仅验证证书是否包含 SHA-2 签名是不够的。您需要检查链中直到根的所有中间证书都没有使用 SHA-1 签名。

    NSS具有一个环境变量NSS_HASH_ALG_SUPPORT,可用于控制使用该库的程序可以使用哪些散列算法。这个环境变量将受到包括 Firefox 在内的许多程序的尊重,curl如果它是在 NSS 支持下编译的(例如 Red Hat Enterprise Linux 和 Fedora)。

    curl -V | fgrep NSS/
    env NSS_HASH_ALG_SUPPORT=-SHA-1 curl -v --head https://www.google.com/
    

    如果curl使用 NSS 支持编译,并且正在使用 SHA-1 证书,则输出将如下所示:

    curl 7.40.0 (x86_64-redhat-linux-gnu) libcurl/7.40.0 NSS/3.18 Basic ECC zlib/1.2.8 libidn/1.29 libssh2/1.5.0
    *   Trying 64.233.166.104...
    * Connected to www.google.com (64.233.166.104) port 443 (#0)
    * Initializing NSS with certpath: sql:/etc/pki/nssdb
    *   CAfile: /etc/pki/tls/certs/ca-bundle.crt
      CApath: none
    * Server certificate:
    *       subject: CN=www.google.com,O=Google Inc,L=Mountain View,ST=California,C=US
    *       start date: Jun 03 09:26:01 2015 GMT
    *       expire date: Sep 01 00:00:00 2015 GMT
    *       common name: www.google.com
    *       issuer: CN=Google Internet Authority G2,O=Google Inc,C=US
    * NSS error -8016 (SEC_ERROR_CERT_SIGNATURE_ALGORITHM_DISABLED)
    * The certificate was signed using a signature algorithm that is disabled because it is not secure.
    * Closing connection 0
    curl: (60) The certificate was signed using a signature algorithm that is disabled because it is not secure.
    More details here: http://curl.haxx.se/docs/sslcerts.html
    
    curl performs SSL certificate verification by default, using a "bundle"
     of Certificate Authority (CA) public keys (CA certs). If the default
     bundle file isn't adequate, you can specify an alternate file
     using the --cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
     the bundle, the certificate verification probably failed due to a
     problem with the certificate (it might be expired, or the name might
     not match the domain name in the URL).
    If you'd like to turn off curl's verification of the certificate, use
     the -k (or --insecure) option.
    Exit 60
    
    • 1

相关问题

  • Apache Django Mod_Wsgi - 自动重新加载应用程序

  • Apache:对多个虚拟主机使用相同的目录指令

  • Apache 上的子域不工作 - 找不到服务器

  • PHP 作为 CGI 还是 Apache 模块?

  • 避免将某些丢失的文件记录到 Apache2 错误日志中

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