summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcheck-vhost-cert20
1 files changed, 20 insertions, 0 deletions
diff --git a/check-vhost-cert b/check-vhost-cert
new file mode 100755
index 0000000..6dcdceb
--- /dev/null
+++ b/check-vhost-cert
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+usage() {
+ echo "Usage: $(basename "$0") <vhost>"
+}
+
+if [[ -z "$1" ]]; then
+ usage
+ exit 1
+fi
+
+vhost="$1"
+
+echo "Checking https://${vhost}:443..."
+openssl s_client \
+ -connect "${vhost}:443" \
+ -servername "$vhost" \
+ <<<"$(echo -en "Host: ${vhost}\nGET /\n")" |& \
+openssl x509 -text | \
+grep -Eo '(Subject|DNS):.*?'