From 4d6bc270cf5e449d9d6cd33f814c9b886e39d313 Mon Sep 17 00:00:00 2001 From: adelviscio Date: Sun, 1 Sep 2013 15:56:15 -0400 Subject: [PATCH] Added openssl s_client to view cert expiration --- cheatsheets/openssl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cheatsheets/openssl b/cheatsheets/openssl index 936d953..f2900c2 100644 --- a/cheatsheets/openssl +++ b/cheatsheets/openssl @@ -8,3 +8,8 @@ openssl req -new -key server.key -out server.csr openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt # (The above commands may be run in sequence to generate a self-signed SSL certificate.) + +To view certificate expiration: ++echo | openssl s_client -connect :443 2> /dev/null | \ +awk '/-----BEGIN/,/END CERTIFICATE-----/' | \ +openssl x509 -noout -enddate