国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 網(wǎng)站 > Nginx > 正文

Nginx服務(wù)器的SSL證書(shū)配置以及對(duì)SSL的反向代理配置

2024-08-30 12:26:19
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

Nginx的SSL證書(shū)配置
1、使用openssl實(shí)現(xiàn)證書(shū)中心
由于是使用openssl架設(shè)私有證書(shū)中心,因此要保證以下字段在證書(shū)中心的證書(shū)、服務(wù)端證書(shū)、客戶端證書(shū)中都相同

Country Name State or Province Name Locality Name Organization Name Organizational Unit NameCountry Name State or Province Name Locality Name Organization Name Organizational Unit Name

 
編輯證書(shū)中心配置文件

vim /etc/pki/tls/openssl.cnf
[ CA_default ] dir    = /etc/pki/CA certs   = $dir/certs   # Where the issued certs are kept crl_dir   = $dir/crl    # Where the issued crl are kept database  = $dir/index.txt  # database index file. #unique_subject = no     # Set to 'no' to allow creation of # several ctificates with same subject. new_certs_dir = $dir/newcerts   # default place for new certs. certificate  = $dir/cacert.pem  # The CA certificate serial   = $dir/serial   # The current serial number crlnumber  = $dir/crlnumber  # the current crl number          # must be commented out to leave a V1 CRL crl    = $dir/crl.pem   # The current CRL private_key  = $dir/private/cakey.pem# The private key RANDFILE  = $dir/private/.rand # private random number file[ req_distinguished_name ] countryName      = Country Name(2 letter code) countryName_default    = CN countryName_min     = 2 countryName_max     = 2 stateOrProvinceName    = State or Province Name (full name) stateOrProvinceName_default  = FJ localityName     = Locality Name (eg, city) localityName_default   = FZ 0.organizationName    = Organization Name (eg, company) 0.organizationName_default  = zdz organizationalUnitName   = Organizational Unit Name (eg, section) organizationalUnitName_default = zdz

創(chuàng)建證書(shū)私鑰

cd /etc/pki/CA/private
 (umask 077;openssl genrsa -out cakey.pem 2048

)
生成自簽證書(shū)

cd /etc/pki/CA/ openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days=3655
2、創(chuàng)建服務(wù)器證書(shū)
mkdir /usr/local/nginx/ssl cd /usr/local/nginx/ssl
 (umask 077;openssl genrsa -out nginx.key 1024)
 openssl req -new -key nginx.key -out nginx.csr openssl ca -in nginx.csr -out nginx.crt -days=3650

3、創(chuàng)建客戶端瀏覽器證書(shū)

(umask 077;openssl genrsa -out client.key 1024)
 openssl req -new -key client.key -out client.csr openssl ca -in client.csr -out client.crt -days=3650

 將文本格式的證書(shū)轉(zhuǎn)換成可以導(dǎo)入瀏覽器的證書(shū)

 openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.p12

4、配置nginx服務(wù)器驗(yàn)證

vim /usr/local/nginx/conf/nginx.conf            
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 奉新县| 凤山县| 常山县| 达尔| 会宁县| 皋兰县| 临潭县| 蕲春县| 砀山县| 临朐县| 蕲春县| 沂南县| 嘉禾县| 化州市| 随州市| 潼南县| 汝阳县| 黄山市| 清苑县| 兴海县| 桑植县| 朔州市| 固阳县| 广水市| 甘谷县| 白城市| 利川市| 惠安县| 广东省| 祁阳县| 云霄县| 任丘市| 瑞丽市| 永昌县| 方城县| 绍兴县| 德格县| 阿拉善右旗| 邹城市| 略阳县| 平安县|