Creating a Windows Self-Signed SSL Certificate for use with IIS

C

I recently showed how to setup an SSL certificate using nginx, in this article I will demonstrate how to create a Self-Signed SSL certificate that can be used with IIS.

Creating the SSL certificate

I am going to leverage Powershell to help create the certificate. Start by opening Powershell in Administrator mode. Next run the following code to create the certificate:

[code]
New-SelfSignedCertificate -DnsName endyourif.local -CertStoreLocation cert:\LocalMachine\My
[/code]

This will create a certificate for the domain named endyourif.local and will help if you want to learn about using SQL Server Convert String to Date with examples.

Now we need to move the certificate from Personal to Trusted. To do this I will use the Certificate Manager. Expand the folder called Personal and select Certificates. Find the newly created certificate and drag it from the Personal folder to Trusted Root Certification Authorities -> Certificates folder.

Next I will export the certificate so I can import it into IIS.

Right-click the certificate and choose All Tasks -> Export. Select Yes to Export Private Key. Check Export all extended properties. Under security choose your local user. Finally click Next and choose a location to save it to.

Import the SSL certificate into IIS

Now it’s time to import the certificate into the IIS website. Open IIS Manager. Under Features open Server Certificates and import the newly created key.

And finally let’s associate the certificate with the website. Select the website you want to enable SSL on. Select Bindings and Select 443. From the drop-down select the SSL certificate that you just added. Click OK and restart the IIS website. Now, in my case, I can open endyourif.local with https.

About the author

By Jamie

My Books