3 ms·
function certchain() { # Usage: certchain # Display PKI chain-of-trust for a given domain # GistID: https://gist.github.com/joshenders/cda9167
by DyslexicAtheist 8y ago
function certchain() {
# Usage: certchain
# Display PKI chain-of-trust for a given domain
# GistID: https://gist.github.com/joshenders/cda916797665de69ebcd
if [[ "$#" -ne 1 ]]; then
echo "Usage: ${FUNCNAME} <ip|domain[:port]>"
return 1
fi
local host_port="$1"
if [[ "$1" != *:* ]]; then
local host_port="${1}:443"
fi
openssl s_client -connect "${host_port}" </dev/null 2>/dev/null | grep -E '\ (s|i):'
}
- joshenders 8y agoI’m flattered
- DyslexicAtheist 8y agohaha, this made my day! small world :)