16

nginx漏洞修复:SSL/TLS 服务器瞬时Diffie-Hellman 公共密钥过弱

 3 years ago
source link: https://xushanxiang.com/2021/06/nginx-dhparam-openssl.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

nginx漏洞修复:SSL/TLS 服务器瞬时Diffie-Hellman 公共密钥过弱

作者: xusx 分类: Linux 发布时间: 2021-06-11 09:39

问题:访问网站提示“ Not Found on Accelerator,Description: Your request on the specified host was not found. Check the location and try again ”,或者浏览器提示“警告:面临潜在安全风险”、“你的连接不是私密连接”、“此网站的安全证书有问题”。

原因:SSL/TLS 服务器瞬时 Diffie-Hellman 公共密钥过弱【原理扫描】。

核心:需编辑 nginx.conf 解决。

1、生成 dhparams.pem

cd /usr/local/nginx/conf
# 上面路径改为你自己的
sudo openssl dhparam -out dhparams.pem 2048
# 生成该参数十分消耗 CPU 资源,在线上服务执行一定要注意!
sudo chmod -R 755 dhparams.pem

2、编辑 nging.conf 文件

添加 ssl_dhparam {path to dhparams.pem} 。保存后记得重启Nginx哦。

ssl_dhparam /usr/local/nginx/conf/dhparams.pem;
# 上面路径改为你自己的

3、openssl查看版本

其实这个可以放到第一步。

# openssl version
OpenSSL 1.1.1d 10 Sep 2019
查看完整信息 # openssl version -a
版本过低的话请先升级openssl

4、检查评级

MySSL 提供了免费的网站 HTTPS 安全评级服务(https://myssl.com/),可以用它来测试了一下你的https网站评级,一般至少的达到A。

如果觉得我的文章对您有用,请随意赞赏。您的支持将鼓励我继续创作!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK