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

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

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

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

喵喵時光機(jī) 2019-02-18 18:58:32
certs=(X509Certificate[])request.getAttribute("javax.servlet.request.X509Certificate"); 這段永遠(yuǎn)都是null不知道是哪里問題?nginx?還是tomcat? 網(wǎng)上搜索了不少信息,但是都沒有解決,有人直接用tomcat來當(dāng)https服務(wù)器是可以解決,但是我真不想那么做 nginx用http和https打開tomcat的頁面都正確了,并且也彈出了證書選擇的對話框,但是服務(wù)端就是不能獲取客戶端的認(rèn)證證書信息 這段是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)驗 獲得超4個贊

在JEE項目中實施SSL雙向認(rèn)證

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

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

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

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

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

老哥你問題解決了沒???

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

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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