EN
OpenSSL - generate localhost *.pem certificate under Windows
5 points
In this short article, we want to show how to generate localhost
*.pem certificate (+ private key) using openssl
command under Windows.
Quick solution (run in cmd.exe):
xxxxxxxxxx
1
openssl.exe req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj '/CN=localhost'
Note: be sure that
openssl.exe
is added to system paths.
Simple steps:
- find
openssl
location path (or installopenssl
that is available in 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:
xxxxxxxxxx
1"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'
Screenshots:

