The quickest solution is: set environment variable RANDFILE to path where the 'random state' file can be written (of course check the file access permissions), eg. in your command prompt:
set RANDFILE=C:MyDir.rnd
openssl genrsa -out my-prvkey.pem 1024
More explanations:
OpenSSL on Windows tries to save the 'random state' file in the following order:
- Path taken from RANDFILE environment variable
- If HOME environment variable is set then : ${HOME}.rnd
- C:.rnd
I'm pretty sure that in your case it ends up trying to save it in C:.rnd (and it fails because lack of sufficient access rights). Unfortunately OpenSSL does not print the path that is actually tries to use in any error messages.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…