Created
November 19, 2021 06:23
-
-
Save kyanny/a355eaa828690160c68506dc1f03d263 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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