# HG changeset patch # User Augie Fackler # Date 1367951955 14400 # Node ID b9e92b79bb003006bf8b73bc8cab01c460046b3c # Parent 745e7cc9c2cda18e830c73612b800102ad2c2597 misc: holding ground for misc shell tricks Right now just a function to dump the SSL certs for a given host:port. diff --git a/.shell.d/99.misc.sh b/.shell.d/99.misc.sh new file mode 100644 --- /dev/null +++ b/.shell.d/99.misc.sh @@ -0,0 +1,8 @@ +function certfor() { + if [ "x$1" = "x" ] ; then + echo 'abort: specify host:port pair as argument' + return 1 + fi + openssl x509 -in <(echo | openssl s_client -showcerts -connect $1 | \ + awk '/-----BEGIN CERTIFICATE-----/,/-----END CERTIFICATE-----/') -noout -text +}