taylorthurlow / panda-motd

a utility for generating a more useful MOTD
MIT License
134 stars 6 forks source link

ssl_certificates error: Unable to find certificate expiration date #37

Closed MarcelRobitaille closed 3 years ago

MarcelRobitaille commented 3 years ago

Bug description

When I run the script, I get ssl_certificates error: Unable to find certificate expiration date in the ssl section

Reproduction steps

Steps to reproduce the behavior:

  1. configure an ssl certificate in the configuration file:
    ssl_certificates:
      enable: true
      certs:
        ...: /etc/letsencrypt/live/.../cert.pem
  2. Run panda-motd

Expected behavior

I expect valid until <date>

Log file

/var/log/panda-motd.error.log exists but it's empty?

OS Information

Configuration File

https://gist.github.com/MarcelRobitaille/19541379a55f19e21a8d8774a55662bf

taylorthurlow commented 3 years ago

Hey, sorry this isn't working for you. Can you post the output of this command? Preferably authenticated as root? (I assume your MOTD builder runs as root, been a while since I used Arch):

openssl x509 -in <SSL_CERT_PATH> -dates
MarcelRobitaille commented 3 years ago

Thanks for your answer. That gives me:

notBefore=Jan  1 04:04:35 2021 GMT
notAfter=Apr  1 04:04:35 2021 GMT
-----BEGIN CERTIFICATE-----
censored 
-----END CERTIFICATE-----
taylorthurlow commented 3 years ago

Found a shortcoming in the regex parsing of that output, it wasn't handling the extra white space after the month name properly. Should have a new release cut shortly!

taylorthurlow commented 3 years ago

Alright v0.0.12 is released, you should be able to update now.

MarcelRobitaille commented 3 years ago

Yeah that's strange. I noticed that. Thank you so much!