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

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


I had the same issue when using GitBash in Windows 7, After hours of search this solved my issue:

winpty openssl genrsa -out ../private.pem -aes256 4096

Let me know if it helps anyone.


It seems you miss to specify the option -new to tell openssl to generate the certificate request. Not sure why openssl does not show any message in this case.

To generate the certificate request with an existing private key you can use:

openssl req -new -key server.key -out server.csr

To generate a self signed certificate with an existing private key you can use:

openssl req -new -x509 -key server.key -out server.cert