Advertisement
opexxx

getSHA1ssl.sh

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