From 77d1dda8b0b4d1aa82f3c4adcbd44b45aca9acd6 Mon Sep 17 00:00:00 2001 From: Taylor Thurlow Date: Wed, 10 Feb 2021 13:29:22 -0800 Subject: [PATCH] Fix whitespace handling in SSL Certificate component Closes #37 --- lib/panda_motd/components/ssl_certificates.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/panda_motd/components/ssl_certificates.rb b/lib/panda_motd/components/ssl_certificates.rb index 4f6a7ba..d4a7357 100644 --- a/lib/panda_motd/components/ssl_certificates.rb +++ b/lib/panda_motd/components/ssl_certificates.rb @@ -93,7 +93,7 @@ def cert_dates(certs) def parse_result(name, path) cmd_result = `openssl x509 -in #{path} -dates` # match indices: 1 - month, 2 - day, 3 - time, 4 - year, 5 - zone - exp = /notAfter=([A-Za-z]+) (\d+) ([\d:]+) (\d{4}) ([A-Za-z]+)\n/ + exp = /notAfter=([A-Za-z]+) +(\d+) +([\d:]+) +(\d{4}) +([A-Za-z]+)\n/ parsed = cmd_result.match(exp) if parsed.nil?