diff --git a/bin/executable_showcert b/bin/executable_showcert index 3ecb4bd..88d7841 100644 --- a/bin/executable_showcert +++ b/bin/executable_showcert @@ -2,6 +2,8 @@ [[ -z $1 ]] && { echo "where to get the cert?" >&2; exit 1; } +PORT=${2:-443} + fetch() { if [[ $1 == "-" ]] then @@ -15,7 +17,7 @@ fetch() { } fetch_remote() { - : | openssl s_client -connect $1:443 2>/dev/null| awk '/BEGIN CERTIFICATE/,/END CERTIFICATE/' + : | openssl s_client -connect $1:${PORT} 2>/dev/null| awk '/BEGIN CERTIFICATE/,/END CERTIFICATE/' } fetch_file() {