一.导读
如果在启动nginx报[emerg] SSL_CTX_set1_curves_list证书错误,可以尝试下我的方法,没准可以解决你的问题
二.环境
1.nginx版本:1.22.1
2.openSSL版本:OpenSSL 3.0.2
三.问题分析
如果你的nginx是最新的1.22.1及以上版本,OpenSSL是1.0的版本,一般会出现这个错误,所以将你的OpenSSL升级最新版本,我用的是3.0.2
四.解决方案
第1步先安装openssl-3.0.2,第二步安装nginx
(一).openssl安装
yum install -y gcc
yum install -y zlib
yum install -y perl-CPAN
perl -MCPAN -e shell
install IPC/Cmd.pm
cd /root/oneinstack/src/openssl-3.0.2
./config --prefix=/root/oneinstack/src/openssl-3.0.2
make && make install
vim /etc/ld.so.conf
在include ld.so.conf.d/*.conf后面添加 /usr/local/openssl/lib64,然后保存,保存后执行ldconfig命令进行更新
进入/usr/local/openssl/bin目录下执行命令已经成功了
./openssl version
ln -s /usr/local/openssl/bin/openssl openssl3
# 自己安装的openssl3
[root@xiangquba bin]# openssl3 version
OpenSSL 3.0.5 5 Jul 2022 (Library: OpenSSL 3.0.5 5 Jul 2022)
# yum 安装的openssl
[root@xiangquba openssl]# openssl version
OpenSSL 1.0.2k-fips 26 Jan 2017
(二).nginx安装
第一步:
cd /root/oneinstack/src/nginx-1.22.1/
第二步:
./configure --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-pcre --with-stream --with-stream_ssl_module --with-stream_realip_module --with-select_module --with-file-aio --with-openssl=/root/oneinstack/src/openssl-3.0.2
第三步:
make && make install
原文链接:启动nginx报[emerg] SSL_CTX_set1_curves_list错误,转载请注明来源!