Linux 下编译openssl

Linux 下编译openssl

下载源码

openssl/releases

编译环境

bash 复制代码
gcc --version # 查看版本

#输出
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bash 复制代码
sudo apt update #更新索引包
sudo apt upgrade gcc # 更新

编译

将下载的源码解压后进入其根目录,打开终端

bash 复制代码
# 配置项目,并指定安装目录
./config --prefix=/home/linux_onnx/下载/openssl3.5.3

#输出
Configuring OpenSSL version 3.5.3 for target linux-x86_64
Using os-specific seed configuration
Created configdata.pm
Running configdata.pm
Created Makefile.in
Created Makefile
Created include/openssl/configuration.h

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************
bash 复制代码
# -j6编译线程数
make -j6

# 输出
/usr/bin/perl util/mkinstallvars.pl PREFIX=. BINDIR=apps APPLINKDIR=ms LIBDIR= INCLUDEDIR=include "INCLUDEDIR=./include" ENGINESDIR=engines MODULESDIR=providers "VERSION=3.5.3" "LDLIBS=-ldl -pthread " > builddata.pm
DEBUG: all keys: APPLINKDIR, BINDIR, CMAKECONFIGDIR, ENGINESDIR, INCLUDEDIR, LDLIBS, LIBDIR, MODULESDIR, PKGCONFIGDIR, PREFIX, VERSION, libdir
No value given for CMAKECONFIGDIR
No value given for PKGCONFIGDIR
No value given for libdir
...
...
bash 复制代码
make install

#输出
make" depend && "make" _build_libs
make[1]: Entering directory '/home/liurui/下载/openssl-3.5.3'
make[1]: Leaving directory '/home/liurui/下载/openssl-3.5.3'
make[1]: Entering directory '/home/liurui/下载/openssl-3.5.3'
make[1]: Nothing to be done for '_build_libs'.
make[1]: Leaving directory '/home/liurui/下载/openssl-3.5.3'
created directory `/home/liurui/下载/openssl3.5.3/lib64'
*** Installing runtime libraries
install libcrypto.so.3 -> /home/liurui/下载/openssl3.5.3/lib64/libcrypto.so.3
install libssl.so.3 -> /home/liurui/下载/openssl3.5.3/lib64/libssl.so.3
*** Installing development files
...
...

由此,编译好的openssl存在于你指定的安装路径中

相关推荐
瑞克-桑切斯2 小时前
7、MySQL 慢查询排查与优化实战指南
java·服务器·数据库
vibecode4 小时前
网站服务器失去响应怎么解决?我把连接超时和读超时这两段计时拆开跑了一遍
运维·服务器
工业一体机老司机5 小时前
Docker部署工控机采集服务 Compose编排与开机自启
运维·docker·容器
迪康Defender5 小时前
终端供应链安全:应用白名单与软件正版化检测落地|终端安全治理实践
运维·服务器·网络·安全·web安全·自动化·运维开发
lzx_0025 小时前
Linux 进程(二) 深入理解进程
linux
沫璃染墨6 小时前
从零入门计算机网络系列(十二):HTTP长连接与会话管理详解——从Connection到Cookie与Session
linux·服务器·c++·tcp/ip·ubuntu·http·交互
温暖小土6 小时前
在 CentOS 上安装 Redis Stack
linux·redis·centos
GeW8 小时前
国产化替代进入深水区之后Linux 与数据库为什么必须走向重建
linux
万联WANFLOW8 小时前
异地厂区视频监控远程运维:从组网到安全的实施要点
运维·网络·安全·企业组网·sdwan
衍玊9 小时前
深入剖析 TCP/IP 网络通信原理与内核实现
服务器·网络·tcp/ip