My customer uses a self signed certificate for an application to work. To be able to work, I have to install the root certificate they used to sign the certificate.
Is it possible to configure a root certificate so it only validates towards one domain ?
As a rule of thumb:
No, implied in trusting the customer's CA certificate is the trust in every certificate signed by that CA.
I don't know of any applications/libraries that have an easy option that allows you as the end-user to select that you'll trust your customers or any other CA certificate only for certain (sub-) domains i.e. only for *.example.com and *.example.org and nothing else.
Mozilla has a similar concern about currently trusted government sponsored CA's as an open attention point and for instance Chrome has extra checks built in for accessing Google sites, which was how the rogue *.google.com certificate and the compromise of the Diginotar CA became public.
But even if you don't trust the CA, you can still import/trust a specific server certificate signed by that CA, which will prevent SSL warnings for the hostnames in that certificate. That should make your application work without errors or complaints.
Exceptions:
A very underused option of the X.509v3 PKI standard is the Name Constraints extension, which allows a CA certificate to contain white- and blacklists of domain name patterns it is authorized to issue certificates for.
You might be lucky and your customer has restrained themselves when they set up their PKI infrastructure and included that Name constraint in their CA certificate. Then you can import their CA certificate directly and know that it can only validate a limited range of domain names.
@CryptoGuy had a pretty good answer here, but I wanted to expand on it.
To paraphrase:
And here's how you make that work (using OpenSSL command line CA)
Create a simple CA
You may skip creating an intermediate CA
Create an intermediate CA request, with Name Constraints.
With this in the
ossl_domain_com.cfg
file:Then, sign that Intermediate domain CA with your CA.
If you skipped creating the intermediate, use your root CA to sign
Now re-sign the original domain's CA under your authority, using their certificate. You can add the CA extensions here.
You may need to use
openssl x509 -x509toreq
to create a request, which you would sign exactly the same way as the intermediate above.Now, add your root CA, intermediate CA, and the domain-cross-ca to your browser's trust database.