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
相关推荐
Johny_Zhao7 小时前
OpenClaw安装部署教程
linux·人工智能·ai·云计算·系统运维·openclaw
YuMiao21 小时前
gstatic连接问题导致Google Gemini / Studio页面乱码或图标缺失问题
服务器·网络协议
chlk1232 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑2 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件2 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
碳基沙盒2 天前
OpenClaw 多 Agent 配置实战指南
运维
深紫色的三北六号2 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash2 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI3 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
十日十行4 天前
Linux和window共享文件夹
linux