1

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?

guntbert
  • 1,825
  • 2
  • 18
  • 21
Alex
  • 412
  • 1
  • 8
  • 14

1 Answers1

4

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).

Steffen Ullrich
  • 184,332
  • 29
  • 363
  • 424