From d5e72ac1b3d1aacec097c1d41decbe748c035f06 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 27 Feb 2024 22:29:09 -0500 Subject: rearrange some more things --- bin/.bin/hostcert | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 bin/.bin/hostcert (limited to 'bin/.bin/hostcert') diff --git a/bin/.bin/hostcert b/bin/.bin/hostcert new file mode 100755 index 0000000..61f519d --- /dev/null +++ b/bin/.bin/hostcert @@ -0,0 +1,8 @@ +#!/bin/sh +set -eu +set -o pipefail + +host="$1" +port="${2:-443}" + +openssl s_client -connect "$host:$port" /dev/null | perl -nle 'print if /BEGIN CERTIFICATE/../END CERTIFICATE/' | openssl x509 -text | perl -nle 'print unless /BEGIN CERTIFICATE/../END CERTIFICATE/' -- cgit v1.2.3-54-g00ecf