测试环境
AnolisOS-8.6-x86_64-minimal.iso
Virtual Box,2 vCPU, 4G RAM, 40 vDisk
安装依赖
yum install -y make gcc
编译安装GmSSL
unzip GmSSL-master.zip
**注:**由于许多系统有自带的 ssl 库,为避免潜在的动态库冲突,此处仅生成静态库
./config --prefix=/usr/local/gmssl --openssldir=/usr/local/gmssl no-shared
make && make install
加到系统环境变量
echo ‘export PATH=“$PATH:/usr/local/gmssl/bin”’ >> ~/.bash_profile
source ~/.bash_profile
查看版本
gmssl version
gmssl ciphers -v |grep SM
OpenVPN编译安装
安装依赖
yum install -y gcc libnl3-devel libcap-ng-devel openssl-devel lz4-devel lzo-devel pam-devel make
tar -zxvf openvpn-2.5.10.tar.gz
cd openvpn-2.5.10
./configure OPENSSL_LIBS=“-L/usr/local/gmssl/lib /usr/local/gmssl/lib/libssl.a /usr/local/gmssl/lib/libcrypto.a -lpthread -ldl”
OPENSSL_CFLAGS=-I/usr/local/gmssl/include --includedir=/usr/local/gmssl/include
–libdir=/usr/local/gmssl/lib --prefix=/usr/local/openvpn
重点1: 两个静态库要指定。
重点2: -lpthread -ldl 要指定。
变量名不能写错, OPENSSL_CFLAGS、 OPENSSL_LIBS
make && make insta
标签:8.6,--,make,GmSSLv2,gmssl,SSL,usr,devel,local From: https://blog.csdn.net/qlau2007/article/details/139458947