简体   繁体   English

Apache Httpd 无法使用 Cipher Suite Honor Order 设置启用 TLS1.0/1.1 支持

[英]Apache Httpd can't enable TLS1.0/1.1 support with Cipher Suite Honor Order settings

My web server cannot open a TLSv1.0/1.1 connection.我的 web 服务器无法打开 TLSv1.0/1.1 连接。 Due to the need to support older client versions.由于需要支持较旧的客户端版本。 Accidentally found that no matter what settings are made, TLSv1.0/1.1 connections cannot be opened, and these two always disappear and appear at the same time.无意中发现不管怎么设置,TLSv1.0/1.1连接都打不开,而且这两个总是同时消失又出现。

The Apache2 version I'm using now is我现在用的Apache2版本是
Server version: Apache/2.4.55服务器版本:Apache/2.4.55
Server built: 2023-01-20T06:45:57服务器构建:2023-01-20T06:45:57

The OpenSSL version I'm using now is我现在用的OpenSSL版本是
OpenSSL 1.1.1n 15 Mar 2022 OpenSSL 1.1.1n 2022 年 3 月 15 日

When I try to remove all configuration about cipher suite, it can support TLS1.0/1.1/1.2/1.3 connection, like this: SSLEngine on当我尝试删除所有关于密码套件的配置时,它可以支持TLS1.0/1.1/1.2/1.3连接,就像这样: SSLEngine on
SSLCertificateFile "something.cer"
SSLCertificateKeyFile "something.key"

When I added the setting about SSL protocol, it also works fine.当我添加关于 SSL 协议的设置时,它也可以正常工作。
SSLProtocol All -SSLv3 -SSLv2

At this point, my web server can provide eight TLS1.0/1.1 cipher suites, which are:至此,我的web服务器可以提供8个TLS1.0/1.1密码套件,分别是:
TLS_RSA_WITH_AES_128_CBC_SHA TLS_RSA_WITH_AES_128_CBC_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA TLS_DHE_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA TLS_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_AES_256_CBC_SHA TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_CAMELLIA_128_CBC_SHA TLS_RSA_WITH_CAMELLIA_128_CBC_SHA
TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA
TLS_RSA_WITH_CAMELLIA_256_CBC_SHA TLS_RSA_WITH_CAMELLIA_256_CBC_SHA
TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA

At this time, it can also support three TLS1.3 cipher suites and about forty or fifty TLS1.2 cipher suites.此时,它还可以支持三个 TLS1.3 密码套件和大约四十或五十个 TLS1.2 密码套件。 When I check with Qualys SSL Labs it says "This server does not support Forward Secrecy with the reference browsers. Grade capped to B".当我检查 Qualys SSL 实验室时,它说“此服务器不支持参考浏览器的前向保密。等级上限为 B”。 Although supporting the old TLS protocol will also be downgraded to B, but I still try to fix the previous problem.虽然支持旧的TLS协议也会降级为B,但我还是尝试修复之前的问题。

So I tried to add the following configuration items, then the problem came, my server no longer supports TLS1.0/1.1.于是我尝试添加如下配置项,然后问题来了,我的服务器不再支持TLS1.0/1.1了。

SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA
SSLHonorCipherOrder On

I don't know why this happened, at first I thought it was part of the cipher suite I specified that didn't support TLS1.0.我不知道为什么会这样,起初我以为它是我指定的不支持 TLS1.0 的密码套件的一部分。 I checked one by one and found that in the TLS1.2 cipher suite list at this time, there are four of the previous eight.我一一查看,发现此时的TLS1.2密码套件列表中,有前面八个中的四个。

Then I first tried to remove the last configuration, and my server supports TLS1.0/1.1 again.然后我先尝试去掉上次的配置,我的服务器又支持TLS1.0/1.1了。 The cipher suites that appear are exactly the ones I found duplicated earlier.出现的密码套件正是我之前发现的重复密码套件。 Then I tried to add this part again, but set SSLHonorCipherOrder off, it still works as before.然后我尝试再次添加这部分,但是将 SSLHonorCipherOrder 设置为关闭,它仍然像以前一样工作。 I don't understand why my server cannot support TLS1.0/1.1 when the option of server preference is turned on.我不明白为什么我的服务器在打开服务器首选项选项时不支持 TLS1.0/1.1。

The SSLHonorCipherOrder On setting means "ensure that the server's cipher preferences are followed instead of the client's". SSLHonorCipherOrder On设置意味着“确保遵循服务器的密码首选项而不是客户端的”。 So if the client sends a mix of cipher sets, and the server list includes non-TLS1.0/1.1 sets earlier in the list, then it'll use these (and TLS1.2) in preference.因此,如果客户端发送混合密码集,并且服务器列表在列表的前面包含非 TLS1.0/1.1 集,那么它将优先使用这些(和 TLS1.2)。 Which actually is exactly what you're looking for: if the client supports a stronger protocol, it should use it.这实际上正是您要寻找的:如果客户端支持更强大的协议,则应该使用它。

You can use the openssl command line tool to quickly check if the server will accept a connection that supports only TLSv1.0:您可以使用 openssl 命令行工具快速检查服务器是否会接受仅支持 TLSv1.0 的连接:

openssl s_client -connect example.com:443 -tls1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM