如何在 nginx 中配置 openssl 引擎 aes-ni

use*_*689 2 openssl nginx aes-ni

我使用引擎AES-NI提高openssl速度(硬件加速)的性能,我的芯片支持引擎AES-NI(Intel(R)Xeon(R)CPU E5620 @ 2.40GHz)。

我尝试安装 openssl 版本1.0.2-chacha1.0.1l

版本 1.0.2 chacha 测试速度 openssl 时使用命令:

openssl speed aes-256-cbc
Run Code Online (Sandbox Code Playgroud)

然后错误:

错误:错误的选项或值

版本 1.0.1 使用 nginx 配置时出错:

nginx: [warn] ENGINE_by_id("aesni") failed (SSL: error:25066067:DSO supportroutines:DLFCN_LOAD:could not load the shared library:filename(/usr/lib/x86_64-linux-gnu/openssl-1.0.1) /engines/libaesni.so):/usr/lib/x86_64-linux-gnu/openssl-1.0.1/engines/libaesni.so:无法打开共享对象文件:没有此类文件或目录错误:25070067:DSO 支持例程: DSO_load:could not load the shared library error:260B6084:engineroutines:DYNAMIC_LOAD:dso not found error:2606A074:engineroutines:ENGINE_by_id:no such engine:id=aesni)

我知道对于 openssl >= 1.0.1 的版本,AES-NI 不能通过引擎工作,也不会出现在 openssl 引擎命令中。默认情况下,它在支持的硬件上处于活动状态。

我在https://www.ruby-forum.com/topic/6873426#1168394 中看到一个命令说“没有配置选项,只要你的 CPU 支持它就可以工作”。

但我没有找到官方消息来源。

请建议使用版本 openssl 和 nginx 配置的解决方案。

小智 5

在 OpenSSL >= 1.0.1 中,EVP 界面中默认启用 AES-NI,并且没有 aesni 引擎。因此,在 nginx 中没有为 OpenSSL 版本 >= 1.0.1 启用 AES-NI 的配置选项,因为它在 OpenSSL 中默认启用(只要您的 CPU 支持它)。对于低于 1.0.1 的 OpenSSL 版本,虽然有可用的补丁,但没有对 AES-NI 的官方支持。

[ http://openssl.6102.n7.nabble.com/have-a-lot-of-troubles-trying-to-get-AES-NI-working-tp44285p44301.html]