IT: How To Create a Self Signed Security (SSL) Certificate and Deploy it to Client Machines

March 29, 2012 at 2:28 PM | Posted in Security | 5 Comments
Tags: , ,

Developers and IT administrators have, no doubt, the need the deploy some website through HTTPS using an SSL certificate. While this process is pretty straightforward for a production site, for the purposes of development and testing you may find the need to use an SSL certificate here as well.

As an alternate to purchasing and renewing a yearly certificate, you can leverage your Windows Server’s ability to generate a self signed certificate which is convenient, easy and should meet these types of needs perfectly.

Creating a Self Signed Certificate on IIS:

While there are several ways to accomplish the task of creating a self signed certificate, we will use the SelfSSL utility from Microsoft. Unfortunately, this doesn’t ship with IIS but it is freely available as part of the IIS 6.0 Resource Toolkit (link provided at the bottom of this article). Despite the name “IIS 6.0″ this utility works just fine in IIS 7.
All that is required is to extract the IIS6RT to get the selfssl.exe utility. From here you can copy it to your Windows directory or a network path/USB drive for future use on another machine (so you don’t have to download and extract the full IIS6RT).
Once you have the SelfSSL utility in place, run the following command (as the Administrator) replacing the values in <> as appropriate:
selfssl /N:CN=<your.domain.com> /V:<number of valid days>
The example below produces a self signed wildcard certificate against “mydomain.com” and sets it to be valid for 9,999 days. Additionally, by answering yes to the prompt, this certificate is automatically configured to bind to port 443 inside the Default Web Site of IIS.

While at this point the certificate is ready to use, it is stored only in the personal certificate store on the server. It is a best practice to also have this certificate set in the trusted root as well.
Go to Start > Run (or Windows Key + R) and enter “mmc”. You may receive a UAC prompt, accept it and an empty Management Console will open.

In the console, go to File > Add/Remove Snap-in.

Add Certificates from the left side.

Select Computer account.

Select Local computer.

Click OK to view the Local Certificate store.

Navigate to Personal > Certificates and locate the certificate you setup using the SelfSSL utility. Right-click the certificate and select Copy.

Navigate to Trusted Root Certification Authorities > Certificates. Right-click on the Certificates folder and select Paste.

An entry for the SSL certificate should appear in the list.

At this point, your server should have no problems working with the self signed certificate.

Exporting the Certificate
If you are going to be accessing a site which uses the self signed SSL certificate on any client machine (i.e. any computer which is not the server), in order to avoid a potential onslaught of certificate errors and warnings the self signed certificate should be installed on each of the client machines (which we will discuss in detail below). To do this, we first need to export the respective certificate so it can be installed on the clients.
Inside of the console with the Certificate Management loaded, navigate to Trusted Root Certification Authorities > Certificates. Locate the certificate, right-click and select All Tasks > Export.

When prompted to export the private key, select Yes. Click Next.

Leave the default selections for the file format and click Next.

Enter a password. This will be used to protect the certificate and users will not be able to import it locally without entering this password.

Enter a location to export the certificate file. It will be in PFX format.

Confirm your settings and click Finish.

The resulting PFX file is what will be installed to your client machines to tell them that your self signed certificate is from a trusted source.

Deploying to Client Machines

Once you have the created the certificate on the server side and have everything working, you may notice that when a client machine connects to the respective URL, a certificate warning is displayed. This happens because the certificate authority (your server) isn’t a trusted source for SSL certificates on the client.

You can click through the warnings and access the site, however you may get repeated notices in the form of a highlighted URL bar or repeating certificate warnings. To avoid this annoyance, you simply need to install the custom SSL security certificate on the client machine.
Depending on the browser you use, this process can vary. IE and Chrome both read from the Windows Certificate store, however Firefox has a custom method of handling security certificates.

Important Note: You should never install a security certificate from an unknown source. In practice, you should only install a certificate locally if you generated it. No legitimate website would require you to perform these steps.

Internet Explorer & Google Chrome – Installing the Certificate Locally
Note: Even though Firefox does not use the native Windows certificate store, this is still a recommended step.
Copy the certificate which was exported from the server (the PFX file) to the client machine or ensure it is available in a network path.
Open the local certificate store management on the client machine using the exact same steps as above. You will eventually end up on a screen like the one below.

On the left side, expand Certificates > Trusted Root Certification Authorities. Right click on the Certificates folder and select All Tasks > Import.

Select the certificate which was copied locally to your machine.

Enter the security password assigned when the certificate was exported from the server.

The store “Trusted Root Certification Authorities” should be prefilled as the destination. Click Next.

Review the settings and click Finish.

You should see a success message.

Refresh your view of the Trusted Root Certification Authorities > Certificates folder and you should see the server’s self signed certificate listed in the store.

One this is done, you should be able to browse to an HTTPS site which uses these certificates and receive no warnings or prompts.

Firefox – Allowing Exceptions

Firefox handles this process a bit differently as it does not read certificate information from the Windows store. Rather than installing certificates (per-se), it allows you to define exceptions for SSL certificates on particular sites.
When you visit a site which has a certificate error, you will get a warning like the one below. The area in blue will name the respective URL you are trying to access. To create an exception to bypass this warning on the respective URL, click the Add Exception button.

In the Add Security Exception dialog, click the Confirm Security Exception to configure this exception locally.

Note that if a particular site redirects to subdomains from within itself, you may get multiple security warning prompts (with the URL being slightly different each time). Add exceptions for those URLs using the same steps as above.

Conclusion

It is worth repeating the notice above that you should never install a security certificate from an unknown source. In practice, you should only install a certificate locally if you generated it. No legitimate website would require you to perform these steps.

 

 

Advertisements

5 Comments »

RSS feed for comments on this post. TrackBack URI

  1. It’s actually a cool and useful piece of info. I am glad that you simply shared this useful info with us. Please stay us informed like this. Thank you for sharing.

  2. Right now it appears like Expression Engine is the best blogging platform out there right now. (from what I’ve read) Is that what you’re using on your blog?

  3. naturally such as your site however you ought to examine the spelling on numerous of the posts. Some of options rife with spelling issues i find it very troublesome to tell the truth nevertheless I am going to certainly give back again.

  4. Hello Web Admin, I noticed that your On-Page SEO is is missing a few factors, for one you do not use all three H tags in your post, also I notice that you are not using bold or italics properly in your SEO optimization. On-Page SEO means more now than ever since the new Google update: Panda. No longer are backlinks and simply pinging or sending out a RSS feed the key to getting Google PageRank or Alexa Rankings, You now NEED On-Page SEO. So what is good On-Page SEO?First your keyword must appear in the title.Then it must appear in the URL.You have to optimize your keyword and make sure that it has a nice keyword density of 3-5% in your article with relevant LSI (Latent Semantic Indexing). Then you should spread all H1,H2,H3 tags in your article.Your Keyword should appear in your first paragraph and in the last sentence of the page. You should have relevant usage of Bold and italics of your keyword.There should be one internal link to a page on your blog and you should have one image with an alt tag that has your keyword….wait there’s even more Now what if i told you there was a simple WordPress plugin that does all the On-Page SEO, and automatically for you? That’s right AUTOMATICALLY, just watch this 4minute video for more information at. WordPress Seo Plugin

  5. If you’re serious about getting tons of free targeted traffic to your site, watch this 1 minute video for free at http://doneforyoutrafficz.com


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.
Entries and comments feeds.

%d bloggers like this: