Implement a Self-signed SSL Certificate in Windows with OpenSSL

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.

  1. Download the latest OpenSSL from the following URL. Normally I used to download the Win64 light version. http://slproweb.com/products/Win32OpenSSL.html
  2. Install the downloaded software to C:\OpenSSL\bin\  folder.
  3. Right-click the openssl.exe and select Run as administrator.
  4. 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
  5. 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 []:.
  6. 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. πŸ™‚
Photo: http://www.pngall.com

Leave a Reply

Your email address will not be published.