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

國(guó)密 SM2 SSL 證書(shū) Nginx 安裝指南 linux版

1、國(guó)密證書(shū) 4證書(shū)文件

2、國(guó)密證書(shū) 2證書(shū)文件



一、獲取國(guó)密證書(shū)

1、在您完成申請(qǐng)西部GDCA服務(wù)器證書(shū)的流程后,下載證書(shū)將獲取一個(gè)證書(shū)包,有以下

*.***.com_sign.crt:簽名證書(shū)

*.***.com_sign.key:簽名證書(shū)私鑰

*.***.com_encrypt.crt:加密證書(shū)

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

image.png

2、加密證書(shū)解密

在線(xiàn)解密:https://myssl.com/key_encryption_decryption.html#tc_cert

簽名私鑰對(duì)應(yīng)下載證書(shū)(三個(gè)文件)中的key.

image.png

image.png

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


二、部署國(guó)密nginx


國(guó)密OpenSSL與國(guó)密Nginx

gmssl_openssl_1.1_bxx.tar.gz

無(wú)縫nginx國(guó)密改造,支持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) 進(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è)是否正常,如下:

image.png



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


*.***.com_sign.crt:簽名證書(shū)

*.***.com_sign.key:簽名證書(shū)私鑰

*.***.com_encrypt.crt:加密證書(shū)

*.***.com_encrypt.key : 加密證書(shū)私鑰


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


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

只需要配置第一條即可

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



配置示例(國(guó)密/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

image.png

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

image.png


三、訪(fǎng)問(wèn)測(cè)試


1、360企業(yè)瀏覽器 設(shè)置,打開(kāi)瀏覽器點(diǎn)擊右上角的按鈕-》“選項(xiàng)”-》“安全設(shè)置”,確!皣(guó)密通信協(xié)議”欄目已勾選

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

image.png

訪(fǎng)問(wèn)效果示例:

image.png


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

收藏 】 【 打印 】   
您可對(duì)文檔進(jìn)行評(píng)分喲~

勾選遇到的問(wèn)題提交給我們,收到反饋后保證及時(shí)修正更新!

提交反饋需要先登陸會(huì)員帳號(hào)

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