Advertisement
Guest User

Untitled

a guest
Sep 4th, 2015
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. if [ -z "$1" ]; then
  4. echo "Usage: `basename $0` hostname [hostname]..."
  5. exit $E_NOARGS
  6. fi
  7.  
  8. until [ -z "$1" ]; do
  9. host=$1
  10.  
  11. if [[ $host != *:* ]]; then
  12. host="$host:443"
  13. fi
  14.  
  15. cert=`echo | openssl s_client -connect $host 2>/dev/null`
  16.  
  17. echo "= $host ="
  18. echo "$cert" | openssl x509 -noout -fingerprint -md5
  19. echo "$cert" | openssl x509 -noout -fingerprint -sha1
  20. echo "$cert" | openssl x509 -noout -fingerprint -sha256
  21. echo
  22.  
  23. shift
  24. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement