Buy from the highest-rated provider   Buy SSL.com Certificate x

When are self-signed certificates acceptable?

This question was posted on Slashdot and it solicited many different responses. UltraLoser posed the question this way:

When is it acceptable to encourage users to accept a self-signed SSL cert? Recently the staff of a certain Web site turned on optional SSL with a self-signed and domain-mismatched certificate for its users and encourages them to add an exception for this certificate. Their defense is that it is just as secure as one signed by a commercial CA; and because their site exists for the distribution of copyrighted material the staff do not want to have their personal information in the hands of a CA. In their situation is it acceptable to encourage users to trust this certificate or is this giving users a false sense of security?

There were hundreds of different responses but many people displayed a mistaken understanding of the purpose of SSL certificates. This is expressed in the first poster's response:

SSL certificates provide one thing, and one thing only: Encryption between the two ends using the certificate.

They do not, and never been able to, provide any verification of who is on either end. This is because literally one second after they are issued, regardless of the level of effort that goes into validating who is doing the buying, someone else can be in control of the certificate, legitimately or otherwise.

Now, I understand perfectly well that Verisign and its brethren have made a huge industry out of scamming consumers into thinking that identification is indeed something that a certificate provides; but that is marketing illusion and nothing more. Hokum and hand-waving.

This is common perception of SSL certificates. It is also completely wrong! It is easy to see why server administrators think this. They think, "I need to get an SSL certificate to secure my server." But the certificate doesn't secure anything. The web server (IIS, Apache, etc.) simply requires a certificate so that it can do the encryption. It could do it all automatically if it wanted. But there is a reason for the SSL certificate. It is required by the server to enable encryption because it is an essential to establishing a trusted/secure connection.

It's All About Trust

A self-signed certificate is like a fake drivers license. Who would accept a fake drivers license? Most people wouldn't. But Internet communication is very different from real-life communication. You have little idea who is sending the information on the other end. The biggest problem with a self-signed certificate, is a man-in-the-middle attack. Even if you are 100% sure that you are on the correct website and you completely trust the site (your email server for example), you could have someone intercept the connection and present you with their own self-signed certificate. You would think that you are using a secure connection with your email server but you are really using a secure connection to an attacker's email server. Oh, and they now have your login credentials and anything else you gave them.

JSBiff explains it well:

It all comes down to, can you determine that you are using the same crypto key that the server is? The reason for signing certificates and the like is to try to detect when you are being hit with a man-in-the-middle attack. In a nutshell, that attack is when you try to open a connection to your 'known' IP address, say, 123.45.6.7. Even though you are connecting to a 'known' IP address of a server you trust, doesn't mean you can necessarily trust traffic from that IP address. Why not? Because the Internet works by passing data from router to router until your data gets to it's destination. Every router in between is an opportunity for malicious code on that router to re-write your packet, and you'd never know the difference, unless you have some way to *verify* that the packet is from the trusted server.

A crypto key, if you have the *correct* key, can verify for you that the data hasn't been tampered with. The problem is, however, that before you can begin encrypted communications, you must do an *unencrypted* key exchange, where the server gives you it's crypto key. Here's where the man-in-the-middle has an opportunity. If your traffic is going through my router, I can intercept the self-signed key from the server, and generate a new self-signed key with the same server name, etc in it, so that it *looks* like the self-signed key from your server, but which allows me to decrypt the communications between you and the server. My router then establishes a connection to the server using the *correct* key, and as data passes between you and the server, I unencrypt the data using the real key, then re-encrypt it using the 'fake' key. So, the data is encrypted between me and the server, and between me and you, but gets unencrypted in my router, giving me the opportunity to spy on your data, or even alter if if I want.

The point of a CA-signed certificate is to give slightly stronger verification that you are actually using the key that belongs to the server you are trying to connect to.

Yes, self-signed keys have some uses - in particular if you happen to know the real key's fingerprint (a fingerprint is a numeric or hex string which identifies a cryptographic key), so that you can verify yourself that you are using the correct key for SSL. If you don't happen to know the fingerprint, it's probably still fine to use self-signed certs on a LAN, where you control all the equipment, so don't have to worry so much about a man-in-the-middle (although, arguably, on a LAN you might not even need encryption).

So, in summary, yes, SSL adds security to the connection, but ONLY if you can verify that the correct SSL key for your server is being used, and not a different key that a hostile router has injected.

Got it? Don't use self-signed certificates for sensitive, public connections. If you don't want to buy an SSL certificate, at least set-up your own certificate authority with its own root certificate. This will still give an error message to visitors unless you or they import the root certificate into the browser, but there is far less of a chance of a man-in-the-middle-attack.

When Is a Self-Signed SSL Certificate Acceptable? - [Slashdot]

Originally posted on Tue Jul 1, 2008

Comments


Alan(2014-12-13)

There truly are some clueless comments on that thread. As you said, the purpose of the certificate is for establishing trust (ie, for the client to verify the identity of the server).

thetrivialstuff(2014-12-13)

Really, the way I think the certificate model should work is this:

1. The first time you connect to a secure site, ANY secure site, your browser says "you've never connected to this site before. It has offered this certificate."

2. You then review the certificate and see what its credentials are. Those credentials might be the fact that a CA signed it, and you may or may not trust that CA. An EQUALLY VALID credential is that you know what the fingerprint should be, because someone communicated it to you earlier by some other means (e.g. your bank gave you a piece of paper that said "when you connect to our online banking site, make sure the certificate you see has this fingerprint").

There should be no difference in validity between these methods in the browsers' UI, because security-wise the fingerprint method is actually more secure (because you're not trusting a third party).

Presently, the browsers give absolute credance to CA-signed certificates, while erroneously advising users that all self-signed certificates are bad and dangerous, sometimes without even giving the user a chance to verify it as correct.

3. If the remote site's certificate changes in ANY way, no matter what, the browser should advise the user. Even if the new certificate is signed by the same CA, the browser should advise the user.

Presently most browsers do not do this, so if a forged certificate (perhaps a CA was compromised, or one of their root certificates was successfully cracked) replaces a legitimate one, the user gets no warning at all. In this case, the CA-signed certificates are far LESS secure than self-signed ones because of the browsers' behaviour: if a trusted self-signed certificate is replaced with a different self-signed certificate, the user at least gets a warning.

Ajedi32(2017-10-24)

Most users are not technically skilled enough to effectively evaluate whether or not to trust a particular cert. 99% of them would simply click "trust" immediately every time the warning pops up, making this proposed scheme almost completely useless.

Not to mention it'd be extremely inconvenient to have to go through a rigorous process of checking the cert for every. single. website. you visit.

Despite its flaws, the current CA-based trust model is better.

xXBlackSoulXx(2018-08-02)

I agree with @thetrivialstuff. The hole system is, at least for me, outrageously expensive, and more insecure than a self-signed certificate, what kind of misses the point of SSL certificates (to be secure). The browser should always alert you for any change of the website's certificate. What about some kind of malicious software (including anti viruses, that are sending all your traffic to a server to "analyze" it for malicious things) that "replaces" (please don't correct me, this is simplified) all trusted certificates with it's own? What would happen? Exactly, the browser think it's 100% trustworthy and there's no need for any alert to the user like "Your bank's website certificate fingerprint seems to have changed, could you check this really quick? [Show certificate button]". What I'm going to do is to make a HTTP redirect to a website, where it says "Hey, we've our own secure certificate that is more secure than others. Please complete the instructions below and click on continue if you're done". Let's Encrypt is no exception, it is free, but has the same problems including all other "secure" and overpriced SSL certificate provider.

BTW, why don't they remove the "I agree to additional processing of my information, including first and third party cookies, for personalized content and advertising as outlined in our Data Sharing Policy" text? We already have enough personalized ads and spam emails.

SSL Confused(2014-12-13)

what about self-signed certs used for client authentication? Can't we trust them? If the server admin receives the client cert directly from the client and imports it in the trust store, can't the self-signed cert now be trusted when the client establishes SSL connection? This seems like a case where self-signed cert would offer strong authentication on the server than if the client presented a CA signed cert, in which case anyone with a cert signed by a trusted CA could connect to the server. This matters if the goal of using SSL is to allow only selected clients to connect and not just anyone with a, say, Verisign cert.

FJ(2015-03-04)

am also confused.. If you buy SSL cert from 3rd CA, will that mean that same cert will be publicly available? what if if we are talking about A server to server communication only, One belongs to company A, another to Company B, they need to integrate using API to access each other's resources, hence a mutual SSL will be needed. Do you need to buy Cert from 3rd party? Or can you just use self signed "with a twist" like if I'm Company A, I will sign Company B's cert, so I'm certain he's who he says he is. Its like saying I dont need someone to vouch for him, I ID'd him becuase I myself signed his Identification docs. something like that...

SSL Shopper(2015-03-04)

They will need to buy a 3rd party trusted certificate. They could also manually allow a particular self-signed certificate but if they rely on the signature, it will need to be updated when the certificate is replaced and if they don't rely on the signature, the certificate could easily be spoofed.

Robert(2014-12-13)

If you can get the client certificate installed on the server beforehand, then there is no problem with a self-signed client certificate because there is no chance of a man-in-the-middle attack.

Robert(2014-12-13)

Duane,

You are correct in distinguishing between different kinds of trust. An SSL Certificate primarily allows a customer to "trust" that the website they're using is actually owned by the company listed on the certificate and that all the encrypted communications will be sent to that company's servers. It can also increase trust a little because a a company is verified by the certificate authority to be an active entity and have a verified address.

However, an SSL certificate doesn't stop the company from lying or commiting fraud. The only way for that kind of trust to be gained is for the customer to use the web site and have a good experience.

Duane(2014-12-13)

For someone trying to clean up the myths surrounding what SSL is and what it isn't you still perpetuate the trust myth, trust is a much to fluid term even in such a specific context to use so flippently.

You aren't trying to establish trust that comes over time by dealing with the same person or compamy repeatedly with amicable outcomes, it certainly doesn't come from some faceless multinational corp that says this is Joe Smith, just like drivers licenses can be faked, Verisign has issued false certificates in the past too.

What SSL certificates really do is try to express a level of confidence that you have that people are telling the truth or acting in good faith, sure this is a type of trust, but it is by no means the same thing as trusting someone with your car or your child.

Kyle H(2014-12-13)

My belief is this: if I run the CA, I know what it's doing. It's been shown that Comodo (at the least) has issued improperly-authenticated certificates (they say they're "domain control validated", but Eddy Nigg of StartCom was able to obtain one for mozilla.com, a domain which he certainly does not control or have the ability to send mail from or place content on the website of).

All TLS certificates do is state that someone has authenticated the endpoint. If I've authenticated the endpoint elsewhere, and I've issued a certificate to it, I know for myself that it's the right entity. The only reason why CAs get into the browsers is because they're theoretically audited and their internal controls are deemed to be sufficient to prevent unauthenticated issuance.

Obviously, in the case of Comodo, this trust was misplaced.

(Nevermind Verisign's mis-issuance of two certificates for Microsoft Corporation way back when, which forced MS to come up with CRL-handling code very quickly.)

I look at my own issuance of certificates very much like signing an OpenPGP key. I've done my due diligence, and if you believe that I have you can add my root to your trusted store.

Duane(2014-12-13)

I didn't bother reading all the comments on the slashdot thread, but I'm sure there is still a bug open on the mozilla bug tracker about Verisign, they are in a position to issue certificates trusted by most browsers, they also control a root server and more directly control .com and .net.

Browsers never warn the user when certificates change, so how do we know we aren't suffering a man in the middle attack being proxied via a Verisign redirection.

A Verisign employee went so far as to say they would issue duplicate certificates to government entities if they were compelled to on one of the Mozilla newsgroups/mailing lists a few years ago.

SSL certificates really shouldn't be trusted for anything more than financial transactions and maybe protecting passwords, after that all bets are off.

X86Inc(2015-11-11)

Is the man in the middle part true to that extent. Doesn't the man in the middle guy need the private key that generated the Self Signed Certificate. My understanding is that an SSL Certificate needs a private key on the Server end that verifies the data, that was encrypted using the public key, sent by the client? What is the likelihood of the "man in the middle" getting your private key. If he is able
to get your private key then you have a different problem other then the self signed certificate issue.

My position is Self Signed Certs are ok between two agreeing parties where the public cert is exchanged through private or other agreed ways.

If the "man in the middle" got your private key then yes he could spoof but then he would not need to generate a false certificate at that point. The question is isn't that always the case. we can make up any scenario and give the "man in the middle" any ability we want to make our case.. Let just say the "man in the middle" gets your server CSR and spoofs your DNS would that not also work with public Certs? After all the Cert is not bound to the IP but to the FQDN

At this point the Verisign's of the world are selling identity checking and charging a subscription to do it. weather they actually verify identity themselves is debatable.

Oliver Broad(2017-09-24)

The point is the man in the middle doesn't need your private key, they can just create their own. The fake certificate authenticates the fake server, which uses the imposter's private key. The fake server can then connect to the real server (using the real cert) and relay everything.

Without either a trusted third party or a "sneakernet" physical hand over how will the *client* know the certificate is the real one.

Robert Chavez(2016-09-29)

How do I create a new TLS/SSL server certificate that is NOT self-signed?

SSL Shopper(2016-09-30)

You will need to order a certificate from a certificate provider (https://www.sslshopper.com/certificate-authority-reviews.html

Michael Wetelainen(2017-02-08)

Bla Bla Bla... All this SSL is just another money grab in layman's terms another way to make money off me and you and anyone else that wants to build a website online. listen we don't live in a fantasy land this is the real world and nothing is truly secure. Just my two cents

Ajedi32(2017-10-24)

Nothing's truly secure huh? So you'd be totally fine with posting your CC number here then?

Just because there's always the possibility of something being compromised, doesn't mean we should just ignore security entirely.

Also, you can get TLS certs for free.

EJP(2017-03-17)

Far too many mistakes above. For example, a web server doesn't 'require a certificate so that it can do the encryption.' It requires it so it can send a Certficate message. The 'The biggest problem with a self-signed certificate is a man-in-the-middle attack' only if the client is incorrectly configured or programmed to accept all self-signed certificates. 'It all comes down to, can you determine that you are using the same crypto key that the server is?' is complete nonsense. 'Before you can begin encrypted communications, you must do an *unencrypted* key exchange, where the server gives you it's crypto key' ditto. The crypto key is never transmitted in SSL.

Ajedi32(2017-10-24)

> For example, a web server doesn't 'require a certificate so that it can do the encryption.'

Yeah, I think that's a typo. It should be "The web server (IIS, Apache, etc.) _doesn't_ simply require a certificate so that it can do the encryption. It could do it all automatically if it wanted."

> The 'The biggest problem with a self-signed certificate is a man-in-the-middle attack' only if the client is incorrectly configured or programmed to accept all self-signed certificates.

Or if the user is programed to accept all self-signed certificates. ;-) I think the point the article is making here is that you can't just blindly accept any certificate a website presents to you, because there might be someone MITMing your connection. If there was no possibility of an active MITM attack, there'd be no problem with just blindly accepting all self-signed certs.

> 'It all comes down to, can you determine that you are using the same crypto key that the server is?' is complete nonsense. 'Before you can begin encrypted communications, you must do an *unencrypted* key exchange, where the server gives you it's crypto key' ditto. The crypto key is never transmitted in SSL.

No, the article is actually completely correct here. The whole purpose of a TLS handshake is to negotiate a shared key between the client and server. This page, for example, uses ECDHE_RSA with P-256 to exchange keys with the server, and the connection is then encrypted with AES_128_GCM using that shared key.

EJP(2017-10-26)

The article is completely incorrect here. The key is never transmitted in TLS, or DHE. It is negotiated independently at both ends via a key agreement algorithm. THe Diffie-Helmann key agreement algorithm. That's what DH stands for. You therefore don't have to 'determine' anything, you 'compute' it.

Ajedi32(2017-10-27)

Actually, upon closer examination of the surrounding context I believe that part isn't talking about Diffie–Hellman key exchange. (Which, by the way, is actually more commonly referred to using the term "key exchange" not "key agreement", even though I agree the later term is technically more accurate.)

Rather, it's talking about the server's public key embedded in the TLS cert. That key absolutely is transmitted in plaintext by the server as part of the TLS handshake, and the client does have to ensure that it's using the same key that the server has before proceeding, otherwise it would be opening itself up to a MITM attack.

EJP(2017-10-29)

The client, on receipt of the CertificateVerify message, has to ensure that the certificate embedding the public key was signed by the corresponding private key, via verifying the digital signature in the message. This proves that the server owns the certificate and that he isn't just a MITM. None of this has anything to do with 'using the same key', or the session key, or encryption.

Ajedi32(2017-10-30)

> None of this has anything to do with 'using the same key'

Yes it does. If the client gets a cert containing a public key that _isn't_ the server's public key and accepts that as valid (i.e. the client is not "using the same crypto key that the server is") then the client is open to a MITM attack.

> or the session key

Agreed. Sorry, that was my own misunderstanding of the article text. Like I said, it sounds like it's talking about the key in the TLS cert, not the session key. (Although, you could also argue that it's impossible to be sure you're using the same session key the server is if you don't even know you're actually talking to the server in the first place. E.g. You're blindly accepting a random self-signed cert.)

> or encryption

Uh... yes it does. When it comes to TLS, encryption without authentication is pretty useless. If you establish a nice, secure, encrypted connection to an attacker's computer, that buys you nothing. The attacker can still read and modify all the data you're sending and receiving.

I think you're just being unnecessarily pedantic in about an article targeted at beginners. This article isn't intended to be an explanation of the low-level implementation details of TLS. It's a high-level description of why it's necessary for certs to be signed by a CA.

EJP(2017-10-31)

1. I haven't stated that authentication isn't necessary, which vitiates most of your reply.

2. You keep saying 'using the same key' as though it means something. It doesn't. 'Using the same key' has no meaning in SSL when referring to the server's public key. The server doesn't use it for anything, for a start. The key that is the same is the session key, not the server's public key. The client uses the server's public key to verify the CertificateVerify digital signature, and that's it. No shared use at all, and no further use of it by the client.

3. I am here correcting a widespread misconception about SSL. I don't see anything unnecessary about that, and it is rather shocking to me that the article hasn't been corrected in the 7 months since I first posted here.

Advertisement • Hide