Skip to content

Instantly share code, notes, and snippets.

@a-yasui
Last active June 6, 2021 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-yasui/206817e30c56a349692ac5e78c83bc9f to your computer and use it in GitHub Desktop.
Save a-yasui/206817e30c56a349692ac5e78c83bc9f to your computer and use it in GitHub Desktop.
SSL Certificate Display
#!/usr/bin/env bash
#
# ./ssl_check.sh <host>
#
# Via: https://serverfault.com/questions/661978/displaying-a-remote-ssl-certificate-details-using-cli-tools
host_name=$1
if [[ "X${host_name}" = "X" ]]; then
echo "./ssl_check.sh <host>"
echo "This script is display the SSL pem list"
exit 1;
fi
echo | openssl s_client -showcerts -servername "${host_name}" -connect "${host_name}:443" 2>/dev/null | openssl x509 -inform pem -noout -text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment