wordpress - 如何在 Apache 中为 Wordpress Bitnami Amazon-Ligthsail 实例禁用 TLS 1.0 和 1.1 以仅启用 TLS 1.2 和 TLS 1.3?

标签 wordpress apache ssl bitnami amazon-lightsail

这是我第一次使用 Amazon Lighsail、Wordpress Multisite、Bitnami 甚至使用 Let's Encrypt;现在看起来一切正常,除了我的虚拟主机文件中的 SSL 指令。

因为似乎主要浏览器(又名 Chrome、Safari/Webkit、Mozilla Firefox 和 IE/Edge)将在新年伊始(即 1 月到 1 月)取消对 TLS 1.0 和 TLS 1.1 的支持三月 – 我想知道如何为 Lightsail 中的新 Wordpress Multisite 实例禁用它们。

在获得 Let’s Encript SSL 证书并成功部署后,我对其进行了测试,以验证 TLS 1.0 和 TLS 1.1 是否与 TLS 1.2 一起启用。 现在看来我的 Apache 版本 2.4.39 也支持 TLS 1.3,我正在尝试启用它并禁用两个旧版本。 在网上阅读我发现我必须更改 httpd.conf 文件才能插入此指令

SSLProtocol -all +TLSv1.2

所以,在 httpd.conf 文件中我找到了这个 block ,这似乎是正确的地方:

# Default SSL Virtual Host configuration.

<IfModule !ssl_module>
LoadModule ssl_module modules/mod_ssl.so
</IfModule>

Listen 443
SSLProtocol all -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA$
SSLPassPhraseDialog  builtin
SSLSessionCache "shmcb:/opt/bitnami/apache2/logs/ssl_scache(512000)"
SSLSessionCacheTimeout  300

<VirtualHost _default_:443>
DocumentRoot "/opt/bitnami/apache2/htdocs"
SSLEngine on
SSLCertificateFile "/opt/bitnami/apache2/conf/mydomain.crt"
SSLCertificateKeyFile "/opt/bitnami/apache2/conf/mydomain.key"

<Directory "/opt/bitnami/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3 >
Require all granted
</IfVersion>
</Directory>

# Error Documents
ErrorDocument 503 /503.html

# Bitnami applications installed with a prefix URL (default)
Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
</VirtualHost>

我尝试简单地更新 httpd.conf 和 httpd-ssl.conf,但没有任何结果:TLS 1.3 不起作用,并且 TLS 1.0 和 TLS 1.1 始终处于启用状态。

现在,我什至读了这个问题

Disabling TLS 1.0 in Apache 2.4

添加后,这是我在 httpd-ssl.conf 文件中的 ssl 指令:

# SSLProtocol all -SSLv3
SSLProtocol  +TLSv1.2 +TLSv1.3
#SSLProtocol all -TLSv1 -SSLv3
SSLProxyProtocol all +TLSv1.2 +TLSv1.3

但是什么都没有改变,现在我真的不知道如何启用 TLS 1.3 并禁用 TLS 1.0 和 TLS 1.1。 当然,每次更改后我都会重新启动 Apache。

最佳答案

我也遇到了这个问题,并整理了以下解决方案:

  1. 从 Lightsail 仪表板打开 SSH 实例
  2. 导航至:/opt/bitnami/apache2/conf/bitnami/
  3. 将以下行添加到 bitnami.conf 文件中的以下位置:

听443
.#SSLProtocol-SSLv2-SSLv3

SSLProtocol TLSv1.2

  • 导航至:/opt/bitnami/apache2/conf/extra
  • 在 httpd-ssl.conf 文件中,将主题标签添加到以下行(不带 . ):
  • .#SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
    .#SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES

    现在从以下几行中删除井号标签,以便它们读取为:

    SSLCipherSuite HIGH:MEDIUM:!SSLv3:!kRSA
    SSLProxyCipherSuite HIGH:MEDIUM:!SSLv3:!kRSA

  • 现在,在#SSL Protocol Support 下,将设置更改为如下所示:
  • .#SSLProtocol all -SSLv3
    SSLProtocol -TLSv1.2 -TLSv1.3 -SSLv3
    .#SSLProxyProtocol all -SSLv3
    SSLProxyProtocol -TLSv1.2 -TLSv1.3 -SSLv3

    使用以下命令重新启动 apache:sudo/opt/bitnami/ctlscript.sh restart apache

    在以下两个位置检查您的网站:
    https://www.whynopadlock.com
    https://www.ssllabs.com/ssltest

    您现在应该获得 A 分数,并且不支持 TLS 1.0 和 TLS 1.1 协议(protocol)。

    关于wordpress - 如何在 Apache 中为 Wordpress Bitnami Amazon-Ligthsail 实例禁用 TLS 1.0 和 1.1 以仅启用 TLS 1.2 和 TLS 1.3?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59417470/

    相关文章:

    asp.net-mvc - ASP.NET MVC RequireHttps

    wordpress - apache 中的段错误 11

    regex - .htaccess 更改为另一个域,具体取决于语言

    javascript - 没有 SSL 的 ASP.NET 表单的数据加密

    css - Wordpress:文本在移动设备上消失

    apache - CentOS 6.5 + Apache 虚拟主机

    ssl - 使用 JavaMail 连接到服务器时,支持的 SSL 版本是什么?

    image - 是否有向移动和 HIDPI/Retina 设备提供图像的良好实践?

    php - WordPress 骨架、VVV、多站点和正确的 Nginx 规则

    wordpress - WP 插件开发 - 短代码上的条件 CSS