Search code examples
rubysslopensslssl-certificate

Programmatically determine SSL certificate's expiration date in Ruby


How can I determine the expiration date of an SSL certificate using the openssl ruby library?

I read these docs. I see how to load the certificate. Just not sure how to determine the expiration date.


Solution

  • After loading, cert.not_after should be your certificate expiration date.