国密SSL(基于Gmssl) Nginx HAProxy 编译与下载,免费 OpenSSL 支持国密

国密资源汇总

物联网国密

使用 Nginx HAProxy 来终结国密 TLS 连接

国密 Nginx 下载,商业使用免费

本站下载编译的国密 Nginx for CentOS 7 下载

本站编译的免费 Gmssl 下载

编译国密 Nginx

需要先安装 git 依赖:yum install git 或者 apt install git

# wget https://github.com/GmSSL/GmSSL/archive/refs/heads/master.zip
# unzip master.zip
# cd GmSSL-master

# clone 开源仓库
git clone https://github.com/GmSSL/GmSSL.git
cd GmSSL

# 编译 Gmssl
./config --prefix=/usr/local/gmssl
make
sudo make install

# 下载 Nginx
wget http://nginx.org/download/nginx-1.21.0.tar.gz
tar -zxf nginx-1.21.0.tar.gz
cd nginx-1.21.0
# 将 auto/lib/openssl/conf 中的全部$ OPENSSL/.openssl/ 修改为 $OPENSSL/ 并保存
sed -i "s/$OPENSSL\/\.openssl\//$OPENSSL\//g" auto/lib/openssl/conf

# 配置

# 安装环境
# yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel

# 其他编译项自行配置
./configure \
--prefix=/usr/local/nginx \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-threads \
--with-openssl="/usr/local/gmssl" \
--with-cc-opt="-I/usr/local/gmssl/include" \
--with-ld-opt="-lm"

# 编译安装
make install

# 测试
/usr/local/nginx/sbin/nginx -t

编译国密 HAProxy

# 下载 HAProxy
wget https://www.haproxy.org/download/2.4/src/haproxy-2.4.1.tar.gz

tar -zxf haproxy-2.4.1.tar.gz
cd haproxy-2.4.1

# 安装环境
# yum -y install gcc gcc-c++ glibc glibc-devel pcre pcre-devel openssl openssl-devel systemd-devel net-tools vim iotop bc zip unzip zlib-devel lrzsz tree screen lsof tcpdump wget ntpdate

# ...待续