Mercurial > dotfiles
comparison .shell.d/99.misc.sh @ 312:b9e92b79bb00
misc: holding ground for misc shell tricks
Right now just a function to dump the SSL certs for a given host:port.
| author | Augie Fackler <raf@durin42.com> |
|---|---|
| date | Tue, 07 May 2013 14:39:15 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 311:745e7cc9c2cd | 312:b9e92b79bb00 |
|---|---|
| 1 function certfor() { | |
| 2 if [ "x$1" = "x" ] ; then | |
| 3 echo 'abort: specify host:port pair as argument' | |
| 4 return 1 | |
| 5 fi | |
| 6 openssl x509 -in <(echo | openssl s_client -showcerts -connect $1 | \ | |
| 7 awk '/-----BEGIN CERTIFICATE-----/,/-----END CERTIFICATE-----/') -noout -text | |
| 8 } |
