Last active
October 26, 2015 13:03
-
-
Save n-johnson/166200b7f0d435244aa9 to your computer and use it in GitHub Desktop.
ssl cert parsing
This file contains hidden or 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
| _ssl() { | |
| local adr=$1; | |
| local _d; | |
| _d=$( | |
| echo -n \ | |
| | openssl s_client -connect "$adr":443 2>/dev/null \ | |
| | openssl x509 -noout -text \ | |
| ); | |
| echo "Certifificate Subject:" | |
| echo "$_d" | grep 'Subject:'; | |
| echo "SNI:" | |
| echo "$_d" \ | |
| | grep "DNS" \ | |
| | tr ',' '\n' \ | |
| | awk -F':' '{print $2}'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment