script to verify if SSL certificate is expired

Q: my website got Certificate for https access, I want to renew it before it got expired.
A: openssl command can check expire date for this. orapki does this as well.

Easy Sample:
echo "" | openssl s_client -connect 1> certx 2>/dev/null; openssl x509 -in certx -noout -dates
notBefore=Jul 15 19:00:54 2008 GMT
notAfter=Jul 15 19:00:54 2009 GMT

use Oracle command $ORACLE_HOME/bin/orapki :
echo "" | openssl s_client -connect 1> /tmp/certx 2>/dev/null; orapki cert display -cert /tmp/certx          Subject:,OU=MSN Hotmail,O=Microsoft Corporation,L=Mountain View,ST=California,C=US
Issuer:         CN=Microsoft Secure Server Authority,DC=redmond,DC=corp,DC=microsoft,DC=com
Valid Until:    Wed Jul 15 19:00:54 GMT 2009


About Pang

Oracle DBA working in database, fusion middleware and identity management and cloud.
This entry was posted in Network. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s