diff options
author | Ben Sima <ben@bsima.me> | 2018-06-13 21:36:56 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2018-06-13 21:36:56 -0700 |
commit | 77c9a177b2b595d4ce25095b58e2388fe33cc97a (patch) | |
tree | 0853d5c92d67538760005b9c4635a90115bd7ba4 /irssi-tls |
init
Diffstat (limited to 'irssi-tls')
-rwxr-xr-x | irssi-tls | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/irssi-tls b/irssi-tls new file mode 100755 index 0000000..50d4fdd --- /dev/null +++ b/irssi-tls @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +bsima_cert=/tmp/bsima.me.cert + +openssl s_client -connect bsima.me:6697 < /dev/null 2>/dev/null | \ + openssl x509 > $bsima_cert + +case "$1" in + cert) openssl x509 -in $bsima_cert -fingerprint -sha256 -noout + ;; + pubkey) openssl x509 -in $bsima_cert -pubkey -noout | \ + openssl pkey -pubin -outform der | \ + openssl dgst -sha256 -c | \ + tr a-z A-Z + ;; + *) echo "usage: $(basename $0) {cert,pubkey}"; exit 1 + ;; +esac + + |