Last active
January 25, 2023 19:15
-
-
Save zunda/8efe9b184aceb8e930fd56f769084c97 to your computer and use it in GitHub Desktop.
Run `openssl x509` on each of certificates obtained with `openssl s_client`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright 2022 zunda <zundan at gmail.com> | |
# | |
# Permission is granted for use, copying, modification, distribution, | |
# and distribution of modified versions of this work as long as the | |
# above copyright notice is included. | |
# | |
connectname=mastodon.zunda.ninja | |
servername=$connectname | |
IFS=@ | |
for pem in `:| openssl s_client -showcerts -connect $connectname:443 -servername $servername 2>/dev/null |\ | |
sed -n 's/-----END CERTIFICATE-----/&@/;/-----BEGIN CERTIFICATE-----/,/-----END CERTIFICATE-----/p'`; do | |
echo $pem | openssl x509 -inform pem -noout -text -certopt no_pubkey,no_sigdump | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment