亚洲色图欧美日韩在线播放-户外操美女逼逼中国-免费久久99国产精品自在现-欧美激情五月综合啪啪-九九日本黄色精品视频-亚洲成年网址青青草原-欧美性爱精品在线免费观看-国产精品一区二区美女-日电影一区二区三区

國密 SM2 SSL 證書 Nginx 安裝指南 linux版

1、國密證書 4證書文件

2、國密證書 2證書文件



一、獲取國密證書

1、在您完成申請西部GDCA服務器證書的流程后,下載證書將獲取一個證書包,有以下

*.***.com_sign.crt:簽名證書

*.***.com_sign.key:簽名證書私鑰

*.***.com_encrypt.crt:加密證書

*.***.com_encryptKeyData.txt:內(nèi)容為已加密的加密證書私鑰片段

image.png

2、加密證書解密

在線解密:https://myssl.com/key_encryption_decryption.html#tc_cert

簽名私鑰對應下載證書(三個文件)中的key.

image.png

image.png

創(chuàng)建 *.**.com_encrypt.key 文件,將獲取的解密后 解密證書私鑰 內(nèi)容填寫進去。


二、部署國密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/下xxxxxxxx
(備用下載地址:http://downinfo.myhostadmin.net/gmssl/gmssl_openssl_1.1_b8.tar.gz)

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/下

(備用下載地址:http://downinfo.myhostadmin.net/gmssl/nginx-1.18.0.zip

4) 解壓 unzip nginx-1.18.0.zip

注:可能需要使用yum install pcre-devel需要安裝pcre-devel

5) 進入目錄 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 進入/usr/local/nginx/sbin 目錄,用 ./nginx -t 命令檢測是否正常,如下:

image.png



配置示例(國密單向 4證書 簽名+加密)


*.***.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;
  }
}


配置示例(國密單向 2證書 只有簽名證書)

只需要配置第一條即可

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;



  location /
  {
    root html;
    index index.html index.htm;
  }
}



配置示例(國密/RSA單向自適應)

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;
  }
}


測試配置是否正確/usr/local/nginx/sbin/nginx -t

image.png

啟動/usr/local/nginx/sbin/nginx

image.png


三、訪問測試


1、360企業(yè)瀏覽器 設置,打開瀏覽器點擊右上角的按鈕-》“選項”-》“安全設置”,確保“國密通信協(xié)議”欄目已勾選

“啟用國密SSL協(xié)議支持”的復選框,如下: 

image.png

訪問效果示例:

image.png


編輯:三五互聯(lián)
日期:2023-09-20

收藏 】 【 打印 】   
您可對文檔進行評分喲~

勾選遇到的問題提交給我們,收到反饋后保證及時修正更新!

提交反饋需要先登陸會員帳號

上一篇:已經(jīng)沒有了。
下一篇:網(wǎng)站批量替換關(guān)鍵詞方法
若文檔內(nèi)容對您沒有幫助,不能解決問題? 您還可以 咨詢在線客服提交工單搜索常見問題 ,我們將竭誠為您服務。
  >> 相關(guān)文章
 
分享至: