第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

nginx+tomcat+雙向SSL認(rèn)證,jsp文件一直不能獲取客戶端證書(shū)信息

nginx+tomcat+雙向SSL認(rèn)證,jsp文件一直不能獲取客戶端證書(shū)信息

喵喵時(shí)光機(jī) 2019-02-18 18:58:32
certs=(X509Certificate[])request.getAttribute("javax.servlet.request.X509Certificate"); 這段永遠(yuǎn)都是null不知道是哪里問(wèn)題?nginx?還是tomcat? 網(wǎng)上搜索了不少信息,但是都沒(méi)有解決,有人直接用tomcat來(lái)當(dāng)https服務(wù)器是可以解決,但是我真不想那么做 nginx用http和https打開(kāi)tomcat的頁(yè)面都正確了,并且也彈出了證書(shū)選擇的對(duì)話框,但是服務(wù)端就是不能獲取客戶端的認(rèn)證證書(shū)信息 這段是NGINX的配置文件的 http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } } upstream tomcat { server 192.168.2.114:8080 fail_timeout=0; } # HTTPS server # server { listen 443 ssl; server_name localhost; ssl_certificate d:/ssl/server.crt; ssl_certificate_key d:/ssl/server.key; ssl_client_certificate d:/ssl/ca.crt; ssl on; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_verify_client on; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { # note, there is not SSL here! plain HTTP is used client_max_body_size 16m; client_body_buffer_size 128k; proxy_pass http://tomcat/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_next_upstream off; proxy_connect_timeout 30; proxy_read_timeout 300; proxy_send_timeout 300; } } } 這段是tomcat的 <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" scheme="https" proxyName="192.168.2.114" proxyPort="443" /> <Valve className="org.apache.catalina.valves.RemoteIpValve" remoteIpHeader="x-forwarded-for" remoteIpProxiesHeader="x-forwarded-by" protocolHeader="x-forwarded-proto"/>
查看完整描述

4 回答

?
蝴蝶不菲

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊

在JEE項(xiàng)目中實(shí)施SSL雙向認(rèn)證

查看完整回答
反對(duì) 回復(fù) 2019-03-01
?
寶慕林4294392

TA貢獻(xiàn)2021條經(jīng)驗(yàn) 獲得超8個(gè)贊

轉(zhuǎn)變下思路!
如果你是為了對(duì)外(不是nginx和tomcat間)的安全,那么nginx已經(jīng)替你認(rèn)證過(guò)了,tomcat就不用了。
你取證書(shū)是為了取用戶名的話,可以在nginx里直接取到$ssl_client_s_dn ,返回建立的SSL連接中客戶端證書(shū)的DN主題字段,里面是包含用戶名的,你直接把這個(gè)存到proxy_set_header里,在后面的應(yīng)用服務(wù)器直接取Header就行了。

查看完整回答
反對(duì) 回復(fù) 2019-03-01
?
蠱毒傳說(shuō)

TA貢獻(xiàn)1895條經(jīng)驗(yàn) 獲得超3個(gè)贊

老哥你問(wèn)題解決了沒(méi)?。?/p>

查看完整回答
反對(duì) 回復(fù) 2019-03-01
  • 4 回答
  • 0 關(guān)注
  • 1055 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)