Getting expiry date of SSL certificate

Kelly Burgess kellyb at montana.com
Fri Jan 19 03:42:47 UTC 2024


On the Mac, I can do the following to get the expiration date of a named certificate in my keychain -

	Calculate certname as "Developer ID Application: Kelly Burgess (76LPV4WMTA)"
	Calculate script as con('security find-certificate -p -c ',kSq,certname,kSq,' | openssl x509 -enddate -noout')
	Calculate script as con('Do shell script ',kDq,script,kDq)
	Do $root.$runapplescript(script,result,error)

That pipes the security find-certificate output to the openssl x509 tool, and in result I get something I could parse and convert to a date -

	'notAfter=Aug 16 11:11:48 2026 GMT'

Kelly


More information about the omnisdev-en mailing list