【问题标题】:SSLCertificateChainFile is obsoleteSSLCertificateChainFile 已过时
【发布时间】:2015-09-30 22:55:23
【问题描述】:

我使用的是 Apache 2.4.12,所以SSLCertificateChainFile 现在已经过时,任何中间证书都应该包含在服务器证书文件中。但是,我无法弄清楚如何执行此操作 - 除了 only 指定文件中的站点证书之外的任何证书组合都会导致无效密钥错误。如何在我使用SSLCertificateFile 指定的文件中正确包含中间证书?

【问题讨论】:

标签: apache ssl mod-ssl


【解决方案1】:

取自 Apache 2.4 模块 mod_ssl 文档:

SSLCertificateFile 指令

文件还可能包括中间 CA 证书,从叶到根排序。 2.4.8 及更高版本支持此功能,已过时 SSLCertificateChainFile

这意味着SSLCertificateFile 指令现在(2.4.8 之后)接受具有完整证书链(从叶到根)的文件。如果您的服务器证书位于domain.crt 中,CA 链文件位于domain-ca.crt 中,您需要将两个文件从叶节点连接到根节点,即从您的服务器证书开始,如

cat domain.crt domain-ca.crt > bundle.crt

并在您网站的 conf 文件中使用该文件:

SSLCertificateFile      /path/to/bundle.crt

(例如,使用Ubuntu默认路径,这些文件将存储在/etc/apache2/ssl/。)

【讨论】:

  • 这确实是正确的解决方案:聚合.crt + ca_bundle.crt,并将其用作SSLCertificateFile
【解决方案2】:

对于 Apache 2.4.8,SSLCertificateChainFile 已过时。但是,它只是被弃用并没有被删除,因此您可以继续使用旧样式。但是,对于 Apache 版本 > 2.4.8,SSLCertificateChainFile 将不起作用。

SSLCertificateChainFile 已弃用

SSLCertificateChainFile 在 2.4.8 版本中已过时,当 SSLCertificateFile 已扩展为还加载中间 CA 服务器证书文件中的证书

来源https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#SSLCertificateChainFile

旧样式(在 Apache

#SSL Directives
SSLEngine on
SSLCertificateFile /etc/ssl/certs/<mydomain.com>.crt
SSLCertificateKeyFile /etc/ssl/private/<mydomain.com>.key
SSLCertificateChainFile /etc/ssl/certs/<full-chain-bundle>.crt

来源: How to Install an SSL Certificate on Apache

新样式(在 Apache >= 2.4.8 上有效)

#SSL Directives
SSLEngine on
SSLCertificateFile /etc/ssl/certs/<full-chain-bundle>.crt
SSLCertificateKeyFile /etc/ssl/private/<mydomain.com>.key

来源:https://codesport.io/lamp-stack-advanced/lets-encrypt-tutorial/#vhost-config

【讨论】:

  • 对我不起作用。我删除了 .crt,然后错误消息表明证书和密钥不匹配。
  • 我认为让这个答案有点混乱的是&lt;full-chain-bundle&gt;.crt 出现在旧配置和新配置中。如果我没记错的话,在旧配置中只有 CA 链 会出现在 SSLCertificateChainFile 调用的文件中,而在新配置中,CA 链应该附加到服务器证书中,进入一个由SSLCertificateFile 调用的完整链。我试图在我的回答中澄清这一点。
  • @JonathanY。是对的:您必须将 domain.crt + chain.crt 合并为一个 bundle.crt,然后将其用作 SSLCertificateFile 到位。仅使用 &lt;full-chain-bundle&gt;.crt 是不够的,这就是这个答案所暗示的!
猜你喜欢
  • 1970-01-01
  • 2010-12-26
  • 2019-05-30
  • 1970-01-01
  • 2011-04-26
  • 2018-05-01
  • 2011-08-02
  • 2011-10-10
相关资源
最近更新 更多