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

One vhost, multiple certificates

· 52CE 我爱测

I have the domain example.com with the subdomains : www.example.com and a.example.com. Let's suppose that I can't buy a wildcard certificate but, I bought the certificates for example.com and www.example.com. Now I bought the cer…

问题原文

原帖链接 · Marin Bînzari · CC BY-SA 3.0

I have the domain example.com with the subdomains : www.example.com and a.example.com. Let's suppose that I can't buy a wildcard certificate but, I bought the certificates for example.com and www.example.com. Now I bought the certificate for a.example.com. The site and it's subdomains are in the same folder, using one Apache vhost file and subdomains are defined as aliases.

  1. Can I merge the certificates into one file ?
  2. What if I used the same key, csr files to generate the certificates ?
  3. Is the ONLY solution to declare the sites in two different vhosts ?

已采纳解答

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

Can I merge the certificates into one file?

No, only one leaf certificate is supported. Although from version 2.4.8 the SSLCertificateFile directive allows multiple certificates in that file, that is only to include intermediate CA certificates, sorted from leaf to root, as a replacement for the SSLCertificateChainFile directive.

The SSLCertificateFile directive can be used multiple times (referencing different filenames) when an RSA, a DSA, and an ECC based server certificate is used in parallel. But you can't use multiple SSLCertificateFile directives to load a certificate for the ServerName and an extra for the ServerAlias.

What if I used the same key, csr files to generate the certificates?

Still no.

Is the ONLY solution to declare the sites in two different vhosts ?

If you have two certificates you need two SSL VirtualHosts.

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

资料来源与适用范围

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

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

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