本文介绍了如何在命令行上检查我的SSL证书是SHA1还是SHA2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How do I check if my SSL Certificate is using SHA1 or SHA2, from the commandline?

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

And yes, i this is similar to this, but i need a cli-tool and i want to understand how it is done.

推荐答案

在搜索了一段时间后,我想到了以下代码段(unix):

after googling for quite some time i came up with the following snippet (unix):

openssl s_client -connect <host>:<port> < /dev/null 2>/dev/null | openssl x509 -text -in /dev/stdin | grep "Signature Algorithm"

windows(感谢Nick Westgate,请参见下文)

windows (thanx Nick Westgate, see below)

certutil -dump cacert.pem | find "Algorithm"

这篇关于如何在命令行上检查我的SSL证书是SHA1还是SHA2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 15:05