Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 321
SundayMonday Avatar asked Sep 16 '25 05:09

SundayMonday


1 Answers

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

like image 115
Joachim Isaksson Avatar answered Sep 19 '25 07:09

Joachim Isaksson