Add script to retrieve SSL certificates with s_client.

This commit is contained in:
David Tomaschik
2015-09-11 15:11:53 -07:00
parent 854e223573
commit a06239095c

8
dotfiles/zshrc.d/ssl.zsh Normal file
View File

@@ -0,0 +1,8 @@
retrieve_ssl_certificate_chain() {
openssl s_client -connect $1 -showcerts < /dev/null | awk \
' BEGIN { incert = 0 }
/-----BEGIN CERTIFICATE-----/ { incert = 1 }
incert == 1 { print $0 }
/-----END CERTIFICATE-----/ { incert = 0 }
' 2>/dev/null
}