commit c697049766b8c0a15b2d776c1b340e8c9c5258be
parent 4440ea9ddf93bb209d13eb919290ac1b7c3d17db
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Sat, 5 Nov 2016 22:32:43 +0100
use SNI with openssl s_client -servername to get the right cert
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ssleft b/ssleft
@@ -8,7 +8,7 @@ HOST="$1"
PORT=${2:-443}
MARGIN=${3:0}
-CERT=$(echo | openssl s_client -connect $HOST:$PORT 2>/dev/null)
+CERT=$(echo | openssl s_client -connect $HOST:$PORT -servername $HOST 2>/dev/null)
DATE=$(echo "$CERT" | openssl x509 -noout -dates)
BDATE=$(echo "$DATE" | grep '^notBefore' | cut -d'=' -f2)
ADATE=$(echo "$DATE" | grep '^notAfter' | cut -d'=' -f2)