Is it OK (from a security perspective) to add only the the server cert to client trusted store with out adding the root Certificate in SSL? In this case whether handshake completes successfully?

  • Try it and see? But as far as I know that's exactly what happens when the browser presents you an untrusted cert and you click "trust", so this should work just fine. It can even improve security because only that particular cert is trusted, and not the entire root CA. Should the CA be compromised, attacker certs will still not be trusted. Aug 14, 2016 at 13:30

2 Answers 2


Yes. What you are asking about is often called "certificate pinning".

When you add a signing cert or root cert to your trust store, you are saying, "I trust all certs signed by this cert". By adding the cert to the client's trust store, you are saying, "I explicitly and directly trust this cert". In the former, you are implicitly trusting many certs, in the latter explicitly trusting exactly one cert.

There are some things to be aware of.

  • Some clients might not support this model. If it's third party software, you'll want to test before you deploy this way
  • you'll need a secure way to deliver the cert to your client. This mechanism has to be trusted and must prevent other, un-trusted certificates from getting onto the client. Web Browsers get their default certs from the browser manufacturer, your OS manufacturer,or from your IT department. If you're going with web browsers and it's for users outside your company, this will be much harder - they can't just connect to your non-root-chained site get a certificate warning and add the cert to their store, as they will have no way to know if they're connected to a malicious site.
  • you'll need a secure mechanism to rotate the certificate when it expires or is compromised.
  • testing your client app may be challenging. You'll want to connect your client app to a test server, which means you'll need a way to set your client app to use the test server's certificate.

You also get some advantages over using root or signing certs in your trust store

  • if it's your custom app and nobody else's certs are in the store, you get a guarantee that clients are only communicating with your servers (until someone replaces the client's trust store)
  • root/signing certs use certificate revocation lists for cert revocation, but nobody monitors those. Your approach will simply replace the cert in the client trust stores to effectively revoke a compromised cert.
  • there is a smaller attack surface. In the web browser standard model, an attacker could go after any trusted root, any explicitly- or implicitly-trusted intermediate cert, or the leaf cert. With cert pinning, only the leaf cert is a target*

*I intentionally ignore attacks against the software, against weak crypto, and against client trust stores, since that's all common to both scenarios.

  • So it is always advisable to add only the root certificate when the cert is signed by an CA and only the Server cert(certificate pinning) when the cert is self signed.
    – Manoj
    Aug 19, 2016 at 7:47
  • Those are the two standard models when dealing with certs. Of course, you can have multiple trusted roots, like in web browsers, or you can have multiple pinned certs. You could theoretically have intermediate certs in your trust store, but that would only make sense if you didn't trust the root but did trust the intermediate for some reason.
    – atk
    Aug 19, 2016 at 12:17
  • Just to reconfirm...So ,If I add the Server Cert or the intermediate cert to the trust store , the validation of the certificate(shown during handshake) will be done till any of the (server cert or intermediate cert) is encountered? ...the validation doesn't require root certificate if we have server cert or intermediate cert in place in trust store?
    – Manoj
    Aug 22, 2016 at 6:20
  • Yes, that is correct. (Don't forget to do regular certificate validity checks, like horsemanship matches common name, current time is between not-before and not-after, etc,)
    – atk
    Aug 22, 2016 at 15:27

No, it won't work, because trust store accepts only root (self-signed) certificates and entire chain must be validated. And validation will fail if root certificate is not presented in the trust store.

  • Thanks for the quick reply...So even though if I add the entire certificate chain to the client trust store..still the client validates the server certificate chain during the handshake till it finds the trusted root?
    – Manoj
    Aug 11, 2016 at 18:06
  • yep. In order to trust particular certificate, root certificate from certificate's chain must be explicitly trusted by the client.
    – Crypt32
    Aug 11, 2016 at 18:35
  • this may be true in some implementations, but it is not true for all client software.
    – atk
    Aug 14, 2016 at 13:49
  • this would be a very bad implementation. Certificate pinning MUST NOT imply general certificate trust and validation procedures. Certificate pinning can be added on top of standard validation procedures.
    – Crypt32
    Aug 14, 2016 at 13:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .