scripts

random scripts
git clone git://parazyd.org/scripts.git
Log | Files | Refs

commit 61c159ab805636b3acc3793a6361fddfd467355a
parent 8f61a806f43371328a0805e6d74432ea3a6790dc
Author: parazyd <parazyd@dyne.org>
Date:   Fri, 17 Mar 2017 22:46:35 +0100

optimize sslget

Diffstat:
Msslget | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/sslget b/sslget @@ -6,15 +6,14 @@ portnum=${2-443} cert="$(echo | openssl s_client -connect $1:$portnum 2>&1 | sed '/BEGIN CERT/,/END CERT/p;d')" -shift - printf "%s\n" "$cert" +shift case "$2" in -fpr*) printf "\n" - printf "%s\n" "$cert" | openssl x509 -noout -fingerprint -sha256 - printf "%s\n" "$cert" | openssl x509 -noout -fingerprint -sha1 - printf "%s\n" "$cert" | openssl x509 -noout -fingerprint -md5 + for i in sha256 sha1 md5; do + printf "%s\n" "$cert" | openssl x509 -noout -fingerprint -${i} + done ;; esac