Languages
[Edit]
EN

openssl - generate localhost *.pem certificate under Windows

5 points
Created by:
Tomeriko
263

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.exe is added to system paths.

 

Detailed description

Simple steps:

  1. find openssl location path (or install openssl with Git for Windows),
  2. open Command Prompt (cmd.exe),
    Hint: motivation to use cmd.exe are freezes that may occur with external terminals.
  3. 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'

Screenshots:

localhost *.pem certificate creation under Windows
localhost *.pem certificate creation under Windows
localhost *.pem certificate created under Windows
localhost *.pem certificate creation under Windows
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join