Skip to content

Instantly share code, notes, and snippets.

@agargiulo
Created December 31, 2020 05:53
Show Gist options
  • Save agargiulo/845edcf95ca3070fd82b1bd4a1553652 to your computer and use it in GitHub Desktop.
Save agargiulo/845edcf95ca3070fd82b1bd4a1553652 to your computer and use it in GitHub Desktop.
function ssl_dates () {
local rem_host="${1}"
local rem_port="${2:-443}"
[[ -n $rem_host ]] || {
echo 'USAGE: ssl_dates host.example.com [8443]' && return 1
}
echo '' | openssl s_client -servername "${rem_host}" -showcerts -connect "${rem_host}:${rem_port}" | openssl x509 -noout -dates
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment