I want to see how my application will behave in case if the SSL certificate expires.

CSR are signed by CA, so they are not self-signed and the validity period is 2 years. For my test I want to set the expiration period as 1 day. I don't have control over the CA so I can't create a new template for a certificate validity of one day.

Is there a way to set the validity period in a CSR?

1 Answer 1


One cannot set arbitrary fields in the CSR. The CA will pick the fields it likes (public key, maybe subject) and fill in the rest of the information in the certificate with what they feel is the right choice. This means that unless the CA allows you to specify your own expiration you will not be able to do this. Public CA likely don't allow you to set the expiration, with private CA you can setup it they way you like best.

If you want to find out what happens if a certificate expires just adjust the clock on the system where the certificate validation is done (i.e. usually the system where you run the browser on).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .