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

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:


New-SelfSignedCertificate -DnsName endyourif.local -CertStoreLocation cert:\LocalMachine\My

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.

Published on Apr 12, 2019

Tags: ASP.NET MVC and Web API Tutorial | ssl

Related Posts

Did you enjoy this article? If you did here are some more articles that I thought you will enjoy as they are very similar to the article that you just finished reading.

Tutorials

Learn how to code in HTML, CSS, JavaScript, Python, Ruby, PHP, Java, C#, SQL, and more.

No matter the programming language you're looking to learn, I've hopefully compiled an incredible set of tutorials for you to learn; whether you are beginner or an expert, there is something for everyone to learn. Each topic I go in-depth and provide many examples throughout. I can't wait for you to dig in and improve your skillset with any of the tutorials below.