Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
host=$1
if [[ -z $host ]]; then
echo "Usage: bash $0 HOSTNAME"
exit 1
fi
echo | openssl s_client -servername $host -connect $host:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > certificate.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment