Today I will talk about how we can create a Self-signed SSL Cert in Windows using OpenSSL. I will provide the step by step details on how to create a private key and self-signed certificate valid for 3 years.
- Download the latest OpenSSL from the following URL. Normally I used to download the Win64 light version. http://slproweb.com/products/Win32OpenSSL.html
- Install the downloaded software to C:\OpenSSL\bin\ folder.
- Right-click the openssl.exe and select Run as administrator.
- Execute the below command to generate the key and certificate.
req -x509 -sha256 -nodes -days 1024 -newkey rsa:2048 -keyout 127.0.0.1.key -out 127.0.0.1.crt
- Then you have to fill in the below information to complete the generation.
Country Name (2 letter code) [XX]:SG
State or Province Name (full name) :.
Locality Name (eg, city) [Default City]: Singapore
Organization Name (eg, company) [Default Company Ltd]: Nay Zaw Lin
Organizational Unit Name (eg, section) :IT Section
Common Name (eg, your name or your server’s hostname) : NZL
Email Address :.
- Finally, you will find the 127.0.0.1.crt and 127.0.0.1.key files created under the C:\OpenSSL\bin\ directory.
That’s it. I hope this will help. 🙂