How do i set the expiry date on my self-signed openssl certificate?



  • The default when you create self-signed certificate is 1 month (30 days)

    To create a longer expiry use the days option.

           -days arg
               Specifies the number of days to make a certificate valid for. The
               default is 30 days. Cannot be used with the -preserve_dates option.
    

    One year expiry.

    $  openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout myselfsigned.key -out mycert.pem
    

Log in to reply
 

© Lightnetics 2024