Search code examples
sslcsr

What FQDN for SSL Certifcate Signing Request when domain A is CNAMEd to domain B


I would like to generate an SSL Certificate Signing Request (CSR) for the procurement and installation of an SSL certificate.

My question surrounds what we should enter for the FQDN given our specific situation

We will be hosting a domain name 'www.foo.com' within our server.

This domain will be accessed via a different domain 'www.bar.com' which will be CNAMEd to our hosted domain 'www.foo.com'

We want the client to see that the domain 'www.bar.com' has a valid SSL certificate.

So my question is, when we generate the CSR do we need to enter 'www.foo.com.' or 'www.bar.com.' as the FQDN for hostname in the CSR?

Edit: It is not intended that the domain name www.foo.com will ever be used to access the website.

Looking at this answer https://serverfault.com/questions/494654/which-fqdn-hostname-to-use-for-ssl-certificate-signing-request-when-using-a-cna it looks like in our CSR we should be using 'www.bar.com.' but confirmation from a suitably qualified person would be appreciated!


Solution

  • www.bar.com

    Whatever FQDN the client requests in the browser should be in the subject of the certificate - no matter what happens in "the background", be that in terms of DNS resolution, backend proxying etc.

    As long as the browser thinks it's talking to www.bar.com, the browser will also expect www.bar.com to be in the certificate