第 2 章 配置支持的 TLS 协议版本
在 Red Hat Enterprise Linux 9 中,所有系统范围的加密策略配置集将 TLS 1.2 定义为最小值。因此,这个 TLS 版本也是目录服务器中最低的版本。但是,如果您只拥有支持较新的 TLS 版本的客户端,您可以将更高的协议版本设置为最小,以提高安全性。
2.1. 使用命令行设置最小和最大 TLS 协议版本 复制链接链接已复制到粘贴板!
您可以使用命令行设置最小和最大 TLS 协议。
不要设置最大 TLS 协议。如果您这样做,您的客户端可能需要使用较弱的 TLS 协议作为其默认标准。如果您没有设置最大 TLS 版本,Directory 服务器总是使用支持最强的版本。
前提条件
- 您在 Directory 服务器中启用了 TLS 加密。
流程
可选:显示 Directory 服务器中当前启用的 TLS 协议:
dsconf -D "cn=Directory Manager" ldap://server.example.com security get | egrep -i "sslVersionMin|sslVersionMax"
# dsconf -D "cn=Directory Manager" ldap://server.example.com security get | egrep -i "sslVersionMin|sslVersionMax" sslversionmin: TLS1.2 sslversionmax: TLS1.3Copy to Clipboard Copied! Toggle word wrap Toggle overflow 设置最小 TLS 协议。例如,要将它设置为 TLS 1.3,请输入:
dsconf -D "cn=Directory Manager" ldap://server.example.com security set --tls-protocol-min="TLS1.3"
# dsconf -D "cn=Directory Manager" ldap://server.example.com security set --tls-protocol-min="TLS1.3"Copy to Clipboard Copied! Toggle word wrap Toggle overflow 请注意,您无法将参数设置为比 TLS 1.2 低的值,这是所有 RHEL 系统范围的加密策略配置集的最低值。
不建议:设置支持最高的 TLS 协议:
dsconf -D "cn=Directory Manager" ldap://server.example.com security set --tls-protocol-max="TLS1.3"
# dsconf -D "cn=Directory Manager" ldap://server.example.com security set --tls-protocol-max="TLS1.3"Copy to Clipboard Copied! Toggle word wrap Toggle overflow 如果将
--tls-protocol-max设置为小于--tls-protocol-min的值,则 Directory 服务器会将最大协议设置为与最小值相同的值。要始终使用强大的支持加密协议作为支持的最大 TLS 版本,请不要设置
--tls-protocol-max。重启实例:
dsctl instance_name restart
# dsctl instance_name restartCopy to Clipboard Copied! Toggle word wrap Toggle overflow
验证
显示支持的 TLS 协议:
dsconf -D "cn=Directory Manager" ldap://server.example.com security get | egrep -i "sslVersionMin|sslVersionMax"
# dsconf -D "cn=Directory Manager" ldap://server.example.com security get | egrep -i "sslVersionMin|sslVersionMax" sslversionmin: TLS1.3 sslversionmax: TLS1.3Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用
openssl实用程序使用特定的 TLS 协议建立安全客户端连接:echo | openssl s_client -connect server.example.com:636 -tls1_3
# echo | openssl s_client -connect server.example.com:636 -tls1_3 ... New, TLSv1.3, Cipher is TLS_AES_128_GCM_SHA256 ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow