Last active
March 19, 2019 13:24
-
-
Save yildirima/d09bebe1cd2ca21abb98e351e82225d0 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
host=$1 | |
verify=$2 | |
openssl s_client -showcerts -verify $verify -connect $host:443 < /dev/null | awk '/BEGIN/,/END/{ if(/BEGIN/){a++}; out="certout"a".pem"; print >out}' | |
openssl x509 -noout -text -purpose -in certout1.crt | |
openssl x509 -noout -text -purpose -in certout2.crt | |
######How to run script########### | |
# bash test.sh google.com 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment