OpenSSL check p12 expiration date

1. Check .p12 / .pfx certificate expiration date:

openssl pkcs12 -in testuser1.pfx -nokeys | openssl x509 -noout -enddate

To specify password in plain text, add -passin pass:”${pass}”

2. Export key and cert from .p12 / .pfx:

openssl pkcs12 -clcerts -nokeys -in myContainer.p12 -out usercert.pem
openssl pkcs12 -nocerts  -in myContainer.p12 -out userkey.pem

3. Connect to HTTPS server with client certificate:

openssl s_client -connect -cert usercert.pem -key userkey.pem

Leave a Reply

Your email address will not be published. Required fields are marked *