一、獲取國密證書
1、在您完成申請(qǐng)西部GDCA服務(wù)器證書的流程后,下載證書將獲取一個(gè)證書包,有以下
*.***.com_sign.crt:簽名證書
*.***.com_sign.key:簽名證書私鑰
*.***.com_encrypt.crt:加密證書
*.***.com_encryptKeyData.txt:內(nèi)容為已加密的加密證書私鑰片段

2、加密證書解密
在線解密:https://myssl.com/key_encryption_decryption.html#tc_cert


創(chuàng)建 *.**.com_encrypt.key 文件,將獲取的解密后 解密證書私鑰 內(nèi)容填寫進(jìn)去。
二、部署國密nginx
國密OpenSSL與國密Nginx
gmssl_openssl_1.1_bxx.tar.gz
無縫nginx國密改造,支持nginx1.6+
編譯部署(以nginx-1.18.0為例)
1) 下載 wget http://download.myhostadmin.net/gmssl/gmssl_openssl_1.1_b8.tar.gz到/root/下
2) 解壓 tar xzfm gmssl_openssl_1.1_b8.tar.gz -C /usr/local
3) 下載wget http://download.myhostadmin.net/gmssl/nginx-1.18.0.zip 到/root/下
4) 解壓 unzip nginx-1.18.0.zip
注:可能需要使用yum install pcre-devel需要安裝pcre-devel
5) 進(jìn)入目錄 cd /root/nginx-1.18.0
6) 編譯配置
./configure \
–without-http_gzip_module \
–with-http_ssl_module \
–with-http_stub_status_module \
–with-http_v2_module \
–with-file-aio \
–with-openssl=”/usr/local/gmssl” \
–with-cc-opt=”-I/usr/local/gmssl/include” \
–with-ld-opt=”-lm”
7) 編譯安裝
make install
8) /usr/local/nginx即為生成的nginx目錄
9)編譯安裝完成后,cd 進(jìn)入/usr/local/nginx/sbin 目錄,用 ./nginx -t 命令檢測(cè)是否正常,如下:

配置示例(國密單向)
*.***.com_sign.crt:簽名證書
*.***.com_sign.key:簽名證書私鑰
*.***.com_encrypt.crt:加密證書
*.***.com_encrypt.key : 加密證書私鑰
server
{
listen 0.0.0.0:443 ssl;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:AES128-SHA:DES-CBC3-SHA:ECC-SM4-CBC-SM3:ECC-SM4-GCM-SM3;
ssl_verify_client off;
ssl_certificate /usr/local/nginx/conf/*.***.com_sign.crt;
ssl_certificate_key /usr/local/nginx/conf/*.***.com_sign.key;
ssl_certificate /usr/local/nginx/conf/*.***.com_encrypt.crt;
ssl_certificate_key /usr/local/nginx/conf/*.***.com_encrypt.key;
location /
{
root html;
index index.html index.htm;
}
}
配置示例(國密/RSA單向自適應(yīng))
server
{
listen 0.0.0.0:443 ssl;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:AES128-SHA:DES-CBC3-SHA:ECC-SM4-CBC-SM3:ECC-SM4-GCM-SM3;
ssl_verify_client off;
ssl_certificate /usr/local/nginx/conf/*.***.com.crt;
ssl_certificate_key /usr/local/nginx/conf/*.***.com.key;
ssl_certificate /usr/local/nginx/conf/*.***.com_sign.crt;
ssl_certificate_key /usr/local/nginx/conf/*.***.com_sign.key;
ssl_certificate /usr/local/nginx/conf/*.***.com_encrypt.crt;
ssl_certificate_key /usr/local/nginx/conf/*.***.com_encrypt.key; location /
{
root html;
index index.html index.htm;
}
}
測(cè)試配置是否正確/usr/local/nginx/sbin/nginx -t

啟動(dòng)/usr/local/nginx/sbin/nginx

三、訪問測(cè)試
1、360企業(yè)瀏覽器 設(shè)置,打開瀏覽器點(diǎn)擊右上角的
“啟用國密SSL協(xié)議支持”的復(fù)選框,如下:

訪問效果示例:
