openssl 升级1.1.1.1k 到 3.0.13

下载

复制代码
https://www.openssl.org/source/
复制代码
 tar -zxvf openssl-3.0.13.tar.gz

cd openssl-3.0.13/

./config enable-fips --prefix=/usr/local --openssldir=/usr/local/openssl

make && make install

将原有openssl备份

复制代码
mv /usr/bin/openssl /usr/bin/openssl.bak
mv /usr/include/openssl /usr/include/openssl.bak

添加新openssl软连接

复制代码
ln -s /usr/local/bin/openssl /usr/bin/openssl
ln -s /usr/local/include/openssl /usr/include/openssl

可以用 which openssl 命令查看路径,如果有神通数据库则路径如下:/usr/local/bin/openssl

ln -s /usr/bin/openssl /usr/local/bin/openssl

库复制过去

复制代码
cd /usr/local/lib64
cp libssl.so.3 /usr/lib/libssl.so.3
cp libcrypto.so.3 /usr/lib/libcrypto.so.3

将新的库文件地址写入记录 so 库的配置文件

复制代码
echo "/usr/local/lib64" >> /etc/ld.so.conf  

ldconfig -v

修改nginx的openssl的配置,auto/lib/openssl/conf将原数据

修改为:

复制代码
            CORE_INCS="$CORE_INCS $OPENSSL/include"
            CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
            #CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
            #CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"



                #CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib"
                #CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib"

                CORE_LIBS="$CORE_LIBS $OPENSSL/lib64/libssl.lib"
                CORE_LIBS="$CORE_LIBS $OPENSSL/lib64/libcrypto.lib"



            #CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
            #CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
            CORE_LIBS="$CORE_LIBS $OPENSSL/libssl.a"
            CORE_LIBS="$CORE_LIBS $OPENSSL/libcrypto.a"

修改src/http/ngx_http_upstream.h

复制代码
新增一个default_port


ngx_uint_t flags;
ngx_str_t host;
u_char *file_name;
ngx_uint_t line;
in_port_t port;
in_port_t default_port; /* 新增一个default_port */
ngx_uint_t no_port; /* unsigned no_port:1 */
复制代码
./configure --prefix=/usr/local/nginx --with-stream --with-http_stub_status_module --with-pcre --with-http_stub_status_module --with-http_ssl_module --with-openssl=../openssl-3.0.13

make

/usr/local/nginx/sbin/nginx -s stop
cp objs/nginx /usr/local/nginx/sbin/nginx
/usr/local/nginx/sbin/nginx
相关推荐
秋风起,再归来~5 分钟前
【Linux庖丁解牛】—进程优先级!
linux·运维·服务器
cosX+sinY25 分钟前
ubuntu 20.04 编译运行lio-sam,并保存为pcd
linux·ubuntu·机器人
Lalolander32 分钟前
设备制造行业如何避免项目管理混乱?
运维·制造·工程项目管理·四算一控·epc·环保设备工程·设备制造
LucianaiB1 小时前
【金仓数据库征文】_AI 赋能数据库运维:金仓KES的智能化未来
运维·数据库·人工智能·金仓数据库 2025 征文·数据库平替用金仓
prinrf('千寻)1 小时前
nacos设置权重进行负载均衡不生效
运维·负载均衡
Lary_Rock1 小时前
Android 编译问题 prebuilts/clang/host/linux-x86
android·linux·运维
熬夜学编程的小王1 小时前
【Linux篇】理解信号:如何通过信号让程序听从操作系统的指令
linux·信号产生·软件条件产生信号
子非衣1 小时前
Windows云主机远程连接提示“出现了内部错误”
服务器·windows
绵绵细雨中的乡音2 小时前
Linux进程学习【基本认知】
linux·运维·学习
Johny_Zhao2 小时前
MySQL 高可用集群搭建部署
linux·人工智能·mysql·信息安全·云计算·shell·yum源·系统运维·itsm