Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created November 19, 2021 06:23
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 kyanny/a355eaa828690160c68506dc1f03d263 to your computer and use it in GitHub Desktop.
Save kyanny/a355eaa828690160c68506dc1f03d263 to your computer and use it in GitHub Desktop.
#!/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