Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are SSL/TLS certificates self-signed if they have no real signature/CA?

I understand that normally an SSL (or more precisely X.509) certificate is supposed to be signed by some certifying authority to assure that it is genuine.

In some cases no such signature exists, e.g. if you generate a cert for testing purposes, or if you are the certifying authority (root certificate). In these cases, self-signed certificates are used.

My question: Why use this weird construct of self-signing? Why can a certificate not simply not have any signature? What does including a self-signed signature gain?

Or is it just because it's technically easier (no special case for no signature) to always have a signature in every certificate, even if it's a meaningless signature?

like image 341
sleske Avatar asked May 16 '09 00:05

sleske


People also ask

Why should a CA signed certificate be used instead of a self-signed certificate?

A CA certificate signed by a publicly trusted CA can build trust among the website visitors, and therefore, it is used to validate public websites. A self-signed certificate is used in private networks.

Do self-signed certificates have a CA?

A self-signed certificate is one that is not signed by a CA at all – neither private nor public. In this case, the certificate is signed with its own private key, instead of requesting it from a public or a private CA.

Why is my SSL certificate self-signed?

That means either the company, known as the certificate authority (CA), is not on the browser's built-in list of trusted certificate providers or that the certificate was issued by the server itself. Certificates issued by the server are often referred to as self-signed certificates.

Does TLS work with self-signed certificate?

A self-signed certificate is a TLS/SSL certificate that is signed by the person who creates it rather than a trusted CA. It's easy to generate a self-signed certificate from a computer, and it can enable you to test a secure website without buying an expensive CA-signed certificate right away.


2 Answers

A certificate has three main parts

  1. identity information
  2. a public key
  3. a digital signature

A certificate is signed by encrypting the first two parts with a private key, then appending that encrypted information to the end of the certificate. If you can decrypt the signature with the public key contained in the certificate, then you know that certificate was signed by the person that holds the matching private key. The signature binds the identity information to the public key. I sign my certificate with my private key so that you know only I can read messages that you might encrypt with my public key.

Now, unless you've really met me in person and I hand you my certificate, you can't really know that the identity information is legitimately mine. The original purpose of certificates was to establish a web of trust by first obtaining the certificates of people that you have met in person, then trusting people that have certificates signed by those people, then those people...

like image 199
Bill the Lizard Avatar answered Oct 04 '22 00:10

Bill the Lizard


If you self-sign the certificate, it proves to someone that you actually control the secret key to that signature - ie, it is your certificate.

Otherwise, you could just create a public key that is random numbers and conforms to the format of a certificate, but isn't a real certificate.

like image 28
Kevin Lacquement Avatar answered Oct 03 '22 23:10

Kevin Lacquement