Showing 1 changed files with 26 additions and 0 deletions
+26
checksslvalidity
... ...
@@ -0,0 +1,26 @@
1
+#!/bin/bash
2
+DOMAIN=$1
3
+
4
+function usage() {
5
+  echo "Usage: $(basename $0) DOMAIN.TLD [port]"
6
+  echo ""
7
+  echo " - DOMAIN.TLD : The tool will be connecting to this domain"
8
+  echo "Optional:"
9
+  echo " - port : If not set 443 will be used"
10
+}
11
+
12
+if [ "" == "$DOMAIN" ]
13
+then
14
+	usage
15
+  exit 1
16
+fi
17
+
18
+PORT=$2
19
+if [ "" == "$PORT" ]
20
+then
21
+  PORT=443
22
+fi
23
+echo Testing $DOMAIN:$PORT
24
+
25
+/bin/echo | /usr/bin/openssl s_client -showcerts -servername $DOMAIN -connect $DOMAIN:$PORT 2>/dev/null | /usr/bin/openssl x509 -inform pem -noout -text| grep -e "DNS:" -e "Issuer:" -e "Not Before:" -e "Not After :"
26
+