激情久久久_欧美视频区_成人av免费_不卡视频一二三区_欧美精品在欧美一区二区少妇_欧美一区二区三区的

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

云服務(wù)器|WEB服務(wù)器|FTP服務(wù)器|郵件服務(wù)器|虛擬主機|服務(wù)器安全|DNS服務(wù)器|服務(wù)器知識|Nginx|IIS|Tomcat|

服務(wù)器之家 - 服務(wù)器技術(shù) - Nginx - nginx配置ssl雙向驗證的方法

nginx配置ssl雙向驗證的方法

2019-10-24 17:04nginx配置網(wǎng) Nginx

這篇文章主要介紹了nginx配置ssl雙向驗證的方法,需要的朋友可以參考下

1、安裝nginx略

2、使用openssl實現(xiàn)證書中心
由于是使用openssl架設(shè)私有證書中心,因此要保證以下字段在證書中心的證書、服務(wù)端證書、客戶端證書中都相同
Country Name
State or Province Name
Locality Name
Organization Name
Organizational Unit Name

編輯證書中心配置文件
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)建證書私鑰
cd /etc/pki/CA/private
(umask 077;openssl genrsa -out cakey.pem 2048)
生成自簽證書
cd /etc/pki/CA/
openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days=3655

3、創(chuàng)建服務(wù)器證書
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

4、創(chuàng)建客戶端瀏覽器證書
(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
將文本格式的證書轉(zhuǎn)換成可以導(dǎo)入瀏覽器的證書
openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.p12  

5、配置nginx服務(wù)器驗證
vim /usr/local/nginx/conf/nginx.conf
ssl on;
ssl_certificate         /usr/local/nginx/ssl/nginx.crt;
ssl_certificate_key     /usr/local/nginx/ssl/nginx.key;
ssl_client_certificate  /usr/local/nginx/ssl/cacert.pem;
ssl_session_timeout     5m;
#ssl_verify_client       on;                         服務(wù)器驗證客戶端,暫時不開啟,讓沒有證書的客戶端可以訪問,先完成單向驗證
ssl_protocols           SSLv2 SSLv3 TLSv1;
nginx配置ssl雙向驗證的方法
點擊“我已充分了解可能的風險”
nginx配置ssl雙向驗證的方法
點擊“添加例外”
nginx配置ssl雙向驗證的方法
點擊“確認安全例外”
nginx配置ssl雙向驗證的方法

 

6、配置雙向驗證
nginx配置開啟ssl_verify_client       on;    
在客戶端瀏覽器沒有安裝證書的情況下訪問

nginx配置ssl雙向驗證的方法
在客戶端瀏覽器導(dǎo)入證書
nginx配置ssl雙向驗證的方法
將在Linux服務(wù)器上生成的客戶端證書下載到windows上
nginx配置ssl雙向驗證的方法
打開火狐瀏覽器的高級選項卡
nginx配置ssl雙向驗證的方法
在證書管理器中的您的證書中點擊導(dǎo)入
nginx配置ssl雙向驗證的方法
選擇證書并導(dǎo)入
nginx配置ssl雙向驗證的方法
再次刷新網(wǎng)頁,彈出“使用確認”點擊確定,就實現(xiàn)了雙向驗證

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 在线成人一区二区 | 欧美无极品 | 一区二区三区四区国产 | av免费大全 | 久久久久一本一区二区青青蜜月 | 久久久久久久久久久国产精品 | 精品中文字幕久久久久四十五十骆 | zzzzzzzxxxxxx日本人 | 中文字幕欧美在线 | av性色全交蜜桃成熟时 | 永久免费不卡在线观看黄网站 | 日韩视频在线一区二区三区 | 欧美爱爱一区二区 | 国产精品久久亚洲 | 免费特黄 | 久久蜜桃精品一区二区三区综合网 | 久久久中 | 欧美色视 | 成人情欲视频在线看免费 | 国产亚洲精品成人 | 亚洲精久久| 中文字幕亚洲欧美 | 欧美视频黄色 | 一级爱爱 | 成人aaaaa片毛片按摩 | 成人亚洲一区 | 国产成人高潮免费观看精品 | 中文字幕在线播放第一页 | 一区二区三区日韩在线观看 | av在线等| 校花被肉干高h潮不断 | 亚洲精品在线观看免费 | 在线观看日本中文字幕 | 国产精品三级a三级三级午夜 | 亚洲伊人色欲综合网 | 日本黄色一级电影 | 欧美黑大粗硬毛片视频 | 欧美人与性禽动交精品 | 亚洲小视频 | 久草免费资源视频 | 成人免费观看毛片 |