I've read that a common way for servers to handle the SSL certificate is that the private key is not encrypted.

Now, a many web servers are getting hacked each day. Assumed that the private key is stored without encryption, the attackers could get the private key for the server's SSL certificate.

Some administrators may (at some point) realize that they got hacked, and some of those may revoke their certificate. Others may not even realize that their server and its SSL certificate got compromised.

Of course, if someone hacks a server, the attacker can manipulate the website. But this probably can get detected quite easily.

However, stealing and using the certificate including the private key is much more subtle and could be used with DNS spoofing for a man in the middle attack. Neither the user nor the server's administrator would detect any issues, but the whole traffic can be read by the attacker.

How is this handled in practice?

Do we have to assume that a server didn't get hacked to trust an SSL connection with a server?


For sites where the security is critical, the key is not a simple password. There's something called Key Input Ceremony for the creation of the key. In this event, three or more people enter part of the key, one after the other, on a special appliance called HSM (Hardware Security Module). The event is attended by legal, audit and compliance staff. It's not something the system administrators create on a file in a server somewhere.

The HSM is responsible for the encryption, and the private key cannot be extracted from it in any way. Extensive anti-tampering mechanisms are employed to detect any tampering attempt and to erase the key if any of its parameters are violated: temperature, voltage, pressure, vibration, to name a few.

In this sites, the SSL encryption is handled by the HSM. The private key is protected inside of it and nobody can extract it.

But there are cases where the private key leaked. In almost every case, the problem was a key poorly handled, or no proper key creation protocol being followed, or dev-mode keys being signed with production certificate requests, or other operational mistakes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.