changes 2

This commit is contained in:
Andrea Mistrali 2021-11-23 17:37:24 +01:00
parent 3abc63bd04
commit 4f2a64d0f3
No known key found for this signature in database
GPG Key ID: 6FB0A77F6D5DA9B2
2 changed files with 3 additions and 3 deletions

View File

@ -1,11 +1,11 @@
usage() { usage() {
echo "x509 <certfile>" echo "x509 <certfile>"
echo "x509 -r <hostname:port>" echo "x509 -r <hostname:port>"
exit 0
} }
[ $# -eq 0 ] && usage [ $# -eq 0 ] && usage
help=0
remote=0 remote=0
while getopts ":hr:" arg; do while getopts ":hr:" arg; do
@ -14,10 +14,10 @@ while getopts ":hr:" arg; do
remote=1 remote=1
host=$OPTARG host=$OPTARG
;; ;;
h) usage h) help=1
;; ;;
esac esac
done done
[ $help -eq 0 ] && usage && return
[ $remote -eq 0 ] && openssl x509 -in $* -noout -text [ $remote -eq 0 ] && openssl x509 -in $* -noout -text
[ $remote -eq 1 ] && openssl s_client -connect $host < /dev/null | openssl x509 -noout -text [ $remote -eq 1 ] && openssl s_client -connect $host < /dev/null | openssl x509 -noout -text

Binary file not shown.