Openssl req -key server.key -out server.csr taking ages to complete

opensslssl-certificate

I am trying to generate my own self-signed ssl certificate with openssl so I can test them out on a dev server on nginx before I buy one. I have created the server.key but when I run the command openssl req -key server.key -out server.csr it just hangs after the enter pass phrase

Any ideas ?

Best Answer

You lack entropy - the randomness the server needs to generate the key.

Try moving the mouse, or hitting random keys on the keyboard - you should see progress when you do.

Alternatively, use this one-liner to generate a self-signed certificate with less steps:

openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout server.key -out server.crt