我试图找到答案,但是没有找到...
如何检查我的SSL证书是否使用SHA1或SHA2?
我问这个问题的原因是它可能与证书在Mozilla浏览器上无法加载有关...
有什么想法吗?我能通过cPanel来检查吗?
请参考这个相关问题的描述,使用命令行:如何在命令行中检查我的SSL证书是SHA1还是SHA2。
以下是命令。将www.yoursite.com:443
替换为您所需的内容。 默认SSL端口为443:
openssl s_client -connect www.yoursite.com:443 < /dev/null 2>/dev/null \
| openssl x509 -text -in /dev/stdin | grep "Signature Algorithm"
对于SHA1,应该返回类似以下内容:
Signature Algorithm: sha1WithRSAEncryption
或者对于较新版本,可以使用以下内容:
Signature Algorithm: sha256WithRSAEncryption
文章《为何Google在加速网络杀死SHA-1》描述了你所期望的内容,并提供了一个精美的图形。
openssl s_client -connect api.cscglobal.com:443 < /dev/null 2>/dev/null | openssl x509 -text -in /dev/stdin | grep "Signature Algorithm" | cut -d ":" -f2 | uniq | sed '/^$/d' | sed -e 's/^[ \t]*//'
我不得不稍微修改一下,以便在Windows系统上使用。以下是适用于Windows的单行版本。
openssl.exe s_client -connect yoursitename.com:443 > CertInfo.txt && openssl x509 -text -in CertInfo.txt | find "Signature Algorithm" && del CertInfo.txt /F
使用http://iweb.dl.sourceforge.net/project/gnuwin32/openssl/0.9.8h-1/openssl-0.9.8h-1-bin.zip在Server 2012 R2上进行了测试。
openssl s_client -connect www.yoursite.com:25 -starttls smtp < /dev/null 2>/dev/null | openssl x509 -text -in /dev/stdin | grep "Signature Algorithm"
。 - Christopher K.