8

Giving the nature of SSL certificates and keys which can be chained, can I (myself) generate a certificate for a subdomain based on the main domain certificate and key which are issued for wildcard subdomains?

The practice here is that I have to setup a new completely different and remote (physically) server for just one subdomain and I want to minimize the risk of the main certificate and keys being jacked, just in case.

can I do this with openssl utility providing my main domain, wildcard cert and keys or should be resigned by the CA again? If can, how?

Thanks

2
7

First, I agree that it's a bad idea to spread wildcard certificates around. Best practice is to use either separate certificates (when the domains live on different servers or virtual hosts), or SAN certificates (when they all live in the same place).

However, you shouldn't be able to use your existing certificate to sign a sub-domain's certificate. SSL certificates are normally issued with a restriction on how they can be used. If you run openssl x509 -in /path/to/cert.pem -noout -text, you will see a part looking like

        X509v3 Extended Key Usage: 
            TLS Web Server Authentication, TLS Web Client Authentication

This means that the certificate can only be used to authenticate a web server or client. It can not be used to sign other certificates (or, at least, no client will trust a certificate signed by this one).

The reason why you can't do this is that there is currently no way for a CA to issue a certificate that can be used to sign other certificates within a given domain only. Therefore, if a trusted CA was to give you a certificate that you could use to sign other certificates, they would in effect give you the ability to impersonate any other site on the internet. This would be bad and that's why they don't do it.

2
  • 1
    "The reason why you can't do this is that there is currently no way for a CA to issue a certificate that can be used to sign other certificates within a given domain only.": TIL why CAs keep doing stupid things like this.
    – Kevin
    Jan 17 '16 at 18:31
  • 1
    @Kevin Yep... There is an extension to restrict signing certificates to only signing certs within a given domain, but it'll take a while until it propagates enough that it'd be usable.
    – Jenny D
    Jan 17 '16 at 18:33

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.