If I have 2 websites, a.example.com and b.example.com. Those sites use TLS and SNI, and require client authentication with certificates created with my own CA.

The use case is that some clients have access to *.example.com, other clients have access only to a.example.com.

Is it possible to create a certificate so that authentication is valid only when used on site a.example.com, and rejected when trying to connect to b.example.com?

Or would I have to create a second CA for this purpose?

In this case, is it possible to have a.example.com validate certificates against either one of those 2 CAs? (if yes the answer might be specific to nginx? or doable if one CA is a subordinate of the other?)

  • You should be able to restrict access based on identities. The certificate is valid, but the ID isn't part of the ACL for that domain.
    – RoraΖ
    Feb 19, 2015 at 14:55

1 Answer 1


Certificates establish authentication (tying a person to an identity), which is the wrong approach to limit access to b.example.com - a user is still themselves on both sites, and all authentication's concerned with is having them prove their identity. Limiting access is authorization, which you should do on your end by actually checking the ID contained in the certificate against your own database to see if they should have access. The certificate contains subject info which should probably include some form of username, and you should be keeping the list of users and who's allowed to access what. That also allows you to change the scope of someone's access without needing to reissue a cert.

Client certs do not tie to domains; that's because they aren't meant to authenticate a server. I should be able to use my certificate anywhere that'll accept it, and with client certs that is what happens.

  • Ok, that's very clear! Now I understand why there's no constraints like a "key usage" field for this. (though in my case it would have been practical to carry the information with the certificate, or accept certificates signed by at least one of 2 CAs...). Thank you! Feb 19, 2015 at 17:14
  • This reminds me of SPKI certificates, which do carry authentication information. I think X.509 also has that, in theory, called "attribute certificates"... but nobody really implements them.
    – grawity
    Feb 19, 2015 at 23:26

You must log in to answer this question.

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