Skip to content

Instantly share code, notes, and snippets.

@a-yasui
Last active Jun 6, 2021
Embed
What would you like to do?
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