How to create Self-Signed SSL Certificate using OpenSSL

In this post, I will show you how to create a Self-Signed certificate using OpenSSL.

Generate Private Key and Certificate Signing Request

A private key and certificate signing request are required to create an SSL certificate. These can be generated with a few simple commands.

C:\> openssl genrsa -des3 -out localhost.key 1024 
--------------------------------------------- Enter pass phrase for site.key: 
Verifying - Enter pass phrase for site.key: 
C:\> mv localhost.key localhost.org.key
C:\> openssl rsa -in localhost.org.key -out localhost.key 
Enter pass phrase for localhost.org.key: writing RSA key 
C:\> openssl req -new -key localhost.key -out server.csr
----------------------------------------------------  
Country Name (2 letter code) [AU]:IN 
State or Province Name (full name) [Some-State]:HR

Generate SSL Certificate

C:\> openssl x509 -req -days 365 -in server.cer -signkey localhost.key -out final.cer

The final.cer file is your site certificate suitable for use with WCF service.

Please do not post any spam link in the comment box😊

Post a Comment (0)
Previous Post Next Post