Skip to content

Instantly share code, notes, and snippets.

@ChatchaiJ
Created September 25, 2017 08:16
Show Gist options
  • Save ChatchaiJ/aef884d5049daab364eaf81d0adf99a0 to your computer and use it in GitHub Desktop.
Save ChatchaiJ/aef884d5049daab364eaf81d0adf99a0 to your computer and use it in GitHub Desktop.
Using openssl's s_client for printing certificates information from a web site
#!/bin/sh
[ -z "$1" ] && echo "Usage: $0 www.example.com" && exit
SERVERNAME="$1"
echo |\
openssl s_client \
-showcerts \
-servername $SERVERNAME \
-connect $SERVERNAME: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