How to Create A Self Signed Certificate

A self signed certificate is a certificate that is signed by the person creating it rather than a trusted certificate authority. Free self signed certificates can enable the same level of encryption as a $1500 certificate signed by a trusted authority, but there are two major drawbacks: a visitor's connection could be hijacked allowing an attacker view all the data sent (thus defeating the purpose of encrypting the connection) and the certificate cannot be revoked like a trusted certificate can. We're going to explain when a self signed certificate should and shouldn't be used and then share tutorials on how to generate a self signed certificate for common platforms like Microsoft IIS, Apache, and Java Keytool.

When to Use a Self Signed Certificate

Never use a self signed certificate on an e-commerce site or any site that transfers valuable personal information like credit cards, social security numbers, etc.

A certificate serves two essential purposes: distributing the public key and verifying the identity of the server so visitors know they aren’t sending their information to the wrong person. It can only properly verify the identity of the server when it is signed by a trusted third party because any attacker can create a self signed certificate and launch a man-in-the-middle attack. If a user just accepts a self signed certificate, an attacker could eavesdrop on all the traffic or try to set up an imitation server to phish additional information out of the user. Because of this, you will almost never want to use a self signed certificate on a server that requires anonymous visitors to connect to your site. In these cases, you really need to lay down a few bucks on a trusted certificate (there are plenty of cheap SSL certificates). However, self signed certificates have their place:

  • An Intranet. When clients only have to go through a local Intranet to get to the server, there is virtually no chance of a man-in-the-middle attack.
  • A development server. There is no need to spend extra cash buying a trusted certificate when you are just developing or testing an application.
  • Personal sites with few visitors. If you have a small personal site that transfers non-critical information, there is very little incentive for someone to attack the connections.

Just keep in mind that visitors will see a warning in their browsers (like the one below) when connecting to an server that uses a self signed certificate until it is permanently stored in their certificate store.

Apache Self signed Certificate Error in Firefox

IIS Logo

Self Signed Certificates In IIS

Creating a self-signed certificate in IIS 7 is much easier to do than in previous versions of IIS. IIS now provides a simple interface for generating a self signed certificate. One drawback, is that the common name of the certificate is always the server name instead of the site name. In order to change the common name, you'll need to follow some additional steps.

How to Create a Self Signed Certificate in IIS 7

Self Signed Certificates for Apache

Apache Self Signed Certificate

Creating a self-signed certificate to secure an Apache site requires the use of OpenSSL. This gives you full control over how the certificate is created.

How to Create and Install an Apache Self Signed Certificate


Java Keytool Logo

Self Signed Certificates for Java

Generating a self-signed certificate with Java Keytool is (usually) the simplest of all the platforms, though you don't get quite as much control as using OpenSSL.

How to Create a Self Signed Certificate using Java Keytool


For more information on creating Self Signed Certificate, see the following links:

 Digg  Reddit

Posted on June 16, 2007
Posts: 6
Security of self signed certificates
Reply #8 on : Sat October 13, 2012, 08:57:31
I am assuming that once the certificate is accepted that you no longer get the invalid certificate message. If only a few people were accessing the site, they would have the correct certificate, and if someone tried to hijack it they would get another invalid certificate message, right?
Is there any other information in the certificate error message that would let a educated user figure out whether the certificate was from the local site?


Posts: 6
Very helpful
Reply #7 on : Mon December 19, 2011, 23:59:34
Very helpful. Thanks so much.
Posts: 2
Re: A bit misleading
Reply #6 on : Fri November 04, 2011, 09:11:10
The connection is actually vulnerable to attack if a self signed certificate is used because anyone can create a self signed certificate with the exact same details (except the private key) and then execute a man-in-the-middle attack to intercept all of the traffic between a client and the server without anyone noticing.
Posts: 6
A bit misleading
Reply #5 on : Thu November 03, 2011, 14:17:25
When I first read this I was mislead in to thinking that a self signed certificate leaves the connection vulnerable to attack by someone other than the certificate issuer e.g. site owner. This seemed wrong to me so I investigated and found that it is only the identity that is not verified by a certificate authority not that the certificated connection is any less secure. Just thought I would clear this up in case anyone else was as confused.
Posts: 2
Re: Name of server root certificate?!
Reply #4 on : Sun October 30, 2011, 09:25:40
Hi Hany,

The "title of the server root certificate" is the filename of the Root Certificate that you created.
Posts: 6
Name of server root certificate?!
Reply #3 on : Sun October 30, 2011, 06:39:52
in the 4th step, from where can I find this name "indicate the title of the server root certificate" ?
Shawn Zernik
Posts: 6
Self Signed Certificate
Reply #2 on : Tue June 07, 2011, 11:56:36
To set up this trust, the clients must trust the root of the server’s certificate. This means, clients have to possess the certificate of the certification authority that issued the server certificate in their Trusted Root Certification Authorities store. You can observe this store via the Certificates snap-in.

The process is mandatory if you are using a certificate not issued by a third part vendor.

To install the server root certificate, do the following on the client.

To install the root Certificate on the client

1. Open the Certificates snap-in console. If you have not previously added in the Certificates snap-in console, you can achieve this by doing the following:
• Click Start, select Run, type mmc, and then tap OK.
• On the File menu, choose Add/Remove Snap-in.
• In the Add or Remove Snap-ins dialog box, in the Available snap-ins file, choose Certificates, and then click Add.
• In the Certificates snap-in dialog box, select Computer account, and at that time click Next.
• In the Select Computer dialog box, click Local computer: (the computer this console is running on), followed by selecting Finish.
• In the Add or Remove snap-ins dialog box, click OK.

2. In the Certificates snap-in console, in the console tree, double click to show more items on Certificates (Local Computer), repeat previous step with Trusted Root Certification Authorities, right-click Certificates, and focus on All Tasks, followed by selecting Import.
3. Once you get to the Welcome to the Certificate Import Wizard page, select Next.
4. On the File to Import page, in the File name box, indicate the title of the server root certificate, then select Next.
5. On the Password page, if you created a pass phrase for the private key linked with the certificate previously, enter the pass phrase.
6. On the Certificates Store page, allow the default selection (Place all certificates in the following store – Trusted Root Certification Authorities), followed by choosing Next.
7. On the Completing the Certificate Import Wizard page, verify that the certificate settings appear as followed:
• Certificate Store Selected by User: Trusted Root Certification Authorities
• Content: Certificate
• File Name: FilePath\<Root_Certificate_Name.cer>, where <Root_Certificate_Name> is the name of the server root certificate.

8. Select Finish.
9. Once the certificate upload has successfully concluded, a confirmation message will show up proving the import was successful. Select OK.
10. With Certificates chosen in the console hierarchy, in the detail panel, confirm that the root certificate of the server has become visible in the file of certificates on the client.

This process can be modified on client computers to use website certificates, remote desktop certificates, and Exchange certificates.

Shawn Zernik
Posts: 6
Self-signed certificate generator
Reply #1 on : Wed May 19, 2010, 02:27:38
Here is an online self-signed certificate generator:

Write a comment

If you have trouble reading the code, click on the code itself to generate a new random code.
Security Code:
Post Comment