性能:SSL信任链顺序是否重要?

时间:2014-06-11 01:30:32

标签: ssl nginx ssl-certificate

据我所知,我可以叠加"添加信任"我把它们放在我的domain.crt文件中然后在服务器上安装它之前的任何oder中的证书。我想大多数浏览器都可以解析这些文件并找出链的正确顺序。但就性能而言,堆叠它们是否正确,这会导致浏览器花费更少的时间来分析证书?

例如,我刚刚安装的证书包含以下需要合并的文件。

domain_com.crt
COMODORSADomainValidationSecureServerCA.crt
COMODORSAAddTrustCA.crt
AddTrustExternalCARoot.crt

假设第一个文件名的内容显示在文件的顶部,这是将它们连接到文件的最佳顺序吗?

2 个答案:

答案 0 :(得分:5)

这不仅仅是性能问题,而是符合TLS规范的问题。

  

我猜大多数浏览器都可以解析这些文件并找出链的正确顺序。

某些浏览器可能容忍,但TLS specification explicitly says that you MUST present the certificate chain in the right order

   certificate_list
      This is a sequence (chain) of certificates.  The sender's
      certificate MUST come first in the list.  Each following
      certificate MUST directly certify the one preceding it.  Because
      certificate validation requires that root keys be distributed
      independently, the self-signed certificate that specifies the root
      certificate authority MAY be omitted from the chain, under the
      assumption that the remote end must already possess it in order to
      validate it in any case.

我认为一些服务器在发送证书链之前读取其配置时可以按正确的顺序重新安排证书链(在这种情况下可能仍存在性能问题),但情况并非总是如此

我还没有尝试使用错误顺序的链配置Nginx,但我知道Apache Httpd将完全按照配置发送链(如果配置错误,顺序错误)。如果有疑问,我建议您按照正确的顺序配置服务器链,以确保它符合TLS规范。

答案 1 :(得分:2)

鉴于整个文件将被加载到内存中,并且(我怀疑)所有证书都将在任何情况下被解析(并且可能放在哈希表中),如果它有很大的不同(我在哪里,我会感到震惊)差异单位是为了这篇文章和迂腐网络的目的而定义的“从磁盘上读取文件所花费的时间。”这假设文件中的证书数量是4,而不是4,000。 / p>

相关问题