整活 · 8 3 月, 2021 0

Nginx启动不能:key too small (SSL)

Nginx启动不能:key too small

引用元:

https://qiita.com/tukiyo3/items/fc579fafc105a2ffd0c0

症状

在CentOS 8配置完nginx.conf的SSL部分后执行systemctl start nginx报错。journal -xe查看错误原因,显示如下信息:

SSL Library Error: error : 140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small

解决方案

CentOS 8

编辑/etc/crypto-policies/config,进行如下修改:

# DEFAULT
LEGACY

然后执行update-crypto-policies重载配置使之生效。之后重启Nginx应该就不会报错了。

Debian系

※ 以下内容为摘抄。我没试过。

编辑/etc/ssl/openssl.cnf,进行如下修改:

# CipherString = DEFAULT@SECLEVEL=2
CipherString = DEFAULT@SECLEVEL=1