Nginx 和 openSSL conf 使用最新的 TLS 协议

Nginx 和 openSSL conf 使用最新的 TLS 协议

自几周以来,我的网络服务器 Niginx 出现了 TLS 协议版本 1.1 和 1.2 的问题:

  • 当用户尝试连接到我的网站时,Web浏览器和Nginx选择仅 TLS 1.0用于连接。

  • 在 Nginx 虚拟主机配置文件中,我提到使用 TLS 1.0、1.1 和 1.2:

ssl_protocols             TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers               AES256-SHA256:AES256-SHA;
ssl_prefer_server_ciphers on;
  • 软件包版本(均为最新版本):

nginx 版本:nginx/1.4.2 已启用 TLS SNI 支持配置参数:--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-cc-opt='-g -O2 -Wp,-D_FORTIFY_SOURCE=2' --with-ld-opt= --with-ipv6

OpenSSL 1.0.1e 2013 年 2 月 11 日

  • Linux 发行版:Debian 7.1 x64

  • Qualys SSL 实验室结果

TLS 1.2 否

TLS 1.1 否

TLS 1.0 是

SSL 3 否

SSL 2 否

  • 我尝试重新启动、更新,注意。我检查了每个虚拟主机的 nginx conf 文件:所有虚拟主机的 ssl_protocols 参数都相同。

我的错误是什么?

谢谢

哈夫林格

答案1

在不弄乱系统自带的已安装 openssl 版本的情况下,您可以尝试使用自定义 openssl 版本构建 nginx。构建 nginx 包时指定以下选项。我使用自定义 rpm 和最新的 openssl 版本执行此操作。

--with-openssl=/home/mschirrmeister/openssl-1.0.1f

构建完成后,在服务器上仅安装 nginx 包,然后再次尝试 ssllabs 测试。现在应该显示对更多版本的支持。

答案2

抱歉我的英语不好。我遇到了同样的情况,花了很长时间才找到原因。nginx 读取的第一个 ssl_protocol 关键字控制着 nginx conf 中所有服务器的 ssl 协议。

将所有服务器配置的“ssl_protocol”值(实际上只需第一个就可以)更改为包含值“TLSv1.2”可能会有效。

openssl 1.0.1e 没问题。但是您的操作系统可能有两个版本的 libssl。(我的是 0.9.8 和 1.0.1e)。所以您的 nginx 可能链接到 libssl 0.9.8。

尝试使用指定的最新版本 openssl 源代码编译 nginx。

答案3

我认为你必须使用

ssl_protocols             TLSv1.2 TLSv1.1 TLSv1;

不是

ssl_protocols             TLSv1 TLSv1.1 TLSv1.2;

答案4

这是生产服务器的工作配置,请尝试:

ssl_session_timeout  10m;
ssl_ciphers      RC4:HIGH:!aNULL:!MD5:!kEDH;
ssl_session_cache shared:SSL:10m;
ssl_prefer_server_ciphers on;

然后重新运行 Qualys ssl。

相关内容