Get certificate fingerprint of HTTPS server from command line?

后端 未结 5 1465

Recently Mercurial has added certificate validation when connecting to HTTPS servers. I\'m trying to clone the wiki repository for a googlecode project at https://wiki

5条回答
  •  萌比男神i
    2020-12-01 09:39

    The page at http://wiki.debuntu.org/wiki/OpenSSL#Retrieving_certificate_informations lists the command lines for that (and printing out the relevant information). From that page and some of the man pages, it seems like what you want is (for bash):

    openssl s_client -connect : < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin
    

    If you want the whole certificate, leave off the | symbol and everything after it.

提交回复
热议问题