In this short article, we want to show how to generate
localhost *.pem certificate (+ private key) using
openssl under Windows.
Quick solution (run in cmd.exe):
openssl.exe req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj '/CN=localhost'
Note: be sure that
openssl.exeis added to system paths.
openssllocation path (or install
opensslwith Git for Windows),
- open Command Prompt (cmd.exe),
Hint: motivation to use cmd.exe are freezes that may occur with external terminals.
- run the following command:
"C:\Program Files\Git\usr\bin\openssl.exe" req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj '/CN=localhost'