系统相关
首页 > 系统相关> > ssl – 如何使用nginx安装letsencrypt证书?

ssl – 如何使用nginx安装letsencrypt证书?

作者:互联网

我已经使用letsencrypt为ubuntu上的最新nginx安装了SSL证书.
设置很好,除了以下情况外,效果很好:

enter image description here

我不太了解SSL知道发生了什么,但我怀疑:
我暂时为Apache安装了SSL证书,刚刚转移到Nginx,因为它支持http / 2.由于nginx插件不稳定但我必须自己安装证书,这就是我所做的:

在我的nginx配置(/etc/nginx/conf/default.conf)中,我添加了:

server {
    listen       80;
    server_name  [domain];
    return 301   https://$host$request_uri;
}

server {
    listen       443 http2;
    listen       [::]:443 http2;
    server_name  [domain];

    ssl on;
    ssl_certificate /etc/letsencrypt/live/[domain]/cert.pem;
    ssl_certificate_key /etc/letsencrypt/live/[domain]/privkey.pem;
}

是否有可能以某种方式打破链条?这里的正确方法是什么?

多谢你们

解决方法:

1)对于强烈的Diffie-Hellman并避免Logjam攻击,请参阅this great manual.

您需要使用这些指令扩展您的nginx配置(在您生成dhparams.pem文件之后):

ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA';
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/ssl/dhparams.pem;

2)对于正确的证书链使用fullchain.pem,而不是cert.pem,有关详细信息,请参阅this great tutorial.

你会得到A级:)

3)作为奖金尝试这项伟大的服务:

“Generate Mozilla Security Recommended Web Server Configuration Files”.

标签:lets-encrypt,nginx,ssl
来源: https://codeday.me/bug/20190824/1705563.html