toptimize sslget - scripts - random scripts
HTML git clone git://parazyd.org/scripts.git
DIR Log
DIR Files
DIR Refs
---
DIR commit 61c159ab805636b3acc3793a6361fddfd467355a
DIR parent 8f61a806f43371328a0805e6d74432ea3a6790dc
HTML Author: parazyd <parazyd@dyne.org>
Date: Fri, 17 Mar 2017 22:46:35 +0100
optimize sslget
Diffstat:
M sslget | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
---
DIR diff --git a/sslget b/sslget
t@@ -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