如何在命令行上检查我的SSL证书是SHA1还是SHA2

tha*_*ere 18 ssl openssl sha1 sha sha256

如何从命令行检查我的SSL证书是否使用SHA1或SHA2?

是的,我这类似于,但我需要一个cli工具,我想了解它是如何完成的.

tha*_*ere 25

谷歌搜索了一段时间后,我想出了以下片段(unix):

openssl s_client -connect <host>:<port> < /dev/null 2>/dev/null | openssl x509 -text -in /dev/stdin | grep "Signature Algorithm"
Run Code Online (Sandbox Code Playgroud)

windows(比克斯韦斯特盖特,见下文)

certutil -dump cacert.pem | find "Algorithm"
Run Code Online (Sandbox Code Playgroud)


小智 17

我知道这个话题很老但我想

openssl x509 -in yourcert.crt -text -noout | grep "Signature Algorithm"
Run Code Online (Sandbox Code Playgroud)

是一个更容易的解决方案.