Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I generate a random serial number for each certificate using openssl x509?

How can I make it so that a random serial number is generated for each new signed certificate issued from a self signed rsa certificate using the openssl command?

I couldn't find anything regarding openssl x509.


1 Answers

The best (cheap and only) way I found was to delete the serial file used for the rootCA ca.srl.

That way, when a new certificate is issued, by using the -CAcreateserial flag, a new random serial is created and thus leveraging the same random number generation used by openssl.