Skip to content

Instantly share code, notes, and snippets.

@antimirov
Forked from SaltwaterC/get_cert.sh
Created April 5, 2019 13:57
Show Gist options
  • Select an option

  • Save antimirov/162922f71faedfa1f8a122b09dc944b6 to your computer and use it in GitHub Desktop.

Select an option

Save antimirov/162922f71faedfa1f8a122b09dc944b6 to your computer and use it in GitHub Desktop.
get_cert
function get_cert()
{
local host="$1"
local port="$2"
if [ -z "$port" ]
then
port="443"
fi
openssl s_client -showcerts -connect $host:$port -servername $host </dev/null 2>/dev/null | openssl x509 -text -noout
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment