Forum Discussion
MickeyM_135861
Feb 18, 2015Nimbostratus
Check bundle certificate expiration date
Hi,
As many of you, I have to create a script to check the expiration date of our certificates (excepting the ones used for our webservers for which the CA send us an alarm).
Using OpenSSL I can...
Mar 26, 2015
Hi MickeyM,
here is a solution which is splitting the original bundle (stored in /var/tmp/ca-bundle.crt for the example) as well into multiple files and runs the openssl verification:awk '/-+BEGIN CERTIFICATE-+/,/-+END CERTIFICATE-+/ {print}' /var/tmp/ca-bundle.crt | \
awk '/-+BEGIN CERTIFICATE-+/ {file="cafile_"++i;} {print > "/var/tmp/"file".tmp";}'
for cert in /var/tmp/cafile_*.tmp; do openssl x509 -noout -subject -enddate -in $cert; done
rm -f /var/tmp/cafile_*.tmp
Temp files were stored as /var/tmp/cafile_.tmp and need to be deleted after test.
Thanks, Stephan PS: Kudos go to the guys at "theunixschool" for some pretty helpful awk-examples.Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects