大网数据广告活动
服务器运维问答

Generate subdomain certificate from valid wildcard certificate

· 52CE 我爱测

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 i…

问题原文

原帖链接 · Tala · CC BY-SA 3.0

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

已采纳解答

原帖链接 · Jenny D · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-01-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。