showcert: allow port selection
This commit is contained in:
parent
5f325914b9
commit
d08429d16c
1 changed files with 3 additions and 1 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue