summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2017-12-02 23:06:28 +0100
committerFlorian Pritz <bluewind@xinu.at>2017-12-02 23:06:28 +0100
commit7f876a9f9aaa76852e3cbbcb57d5fd09a29b0373 (patch)
treec277ebf2535f1aba080476f83e3bbb7f2b200de0
parentc6bea34aa32521ed792fb70606e2a4d5f3a5bd8b (diff)
downloadbin-7f876a9f9aaa76852e3cbbcb57d5fd09a29b0373.tar.gz
bin-7f876a9f9aaa76852e3cbbcb57d5fd09a29b0373.tar.xz
Add check-vhost-cert
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-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):.*?'