Skip to content

Instantly share code, notes, and snippets.

@DoctorD90
Created August 18, 2021 21:00
Show Gist options
  • Save DoctorD90/b8ef294c82b78ab807de6c533194e5c1 to your computer and use it in GitHub Desktop.
Save DoctorD90/b8ef294c82b78ab807de6c533194e5c1 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Replace with the hostname/FQDN of the Server
sslhost=github.com
# Replace with the SSL port of the Server
sslport=443
sslcert=$(openssl s_client -showcerts -connect "$sslhost":"$sslport" < /dev/null)
echo "$sslcert" | openssl x509 -noout -serial
echo "$sslcert" | openssl x509 -noout -hash
echo "$sslcert" | openssl x509 -noout -dates
echo "$sslcert" | openssl x509 -noout -fingerprint -md5
echo "$sslcert" | openssl x509 -noout -fingerprint -sha1
echo "$sslcert" | openssl x509 -noout -fingerprint -sha256
echo "$sslcert" | openssl x509 -noout -fingerprint -sha512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment