Jetty 9.3.6 + Spring:HTTPS自动重定向到HTTP

时间:2016-01-16 01:19:34

标签: spring spring-mvc redirect embedded-jetty jetty-9

我不知道为什么,但我的HTTPS请求会自动重定向到HTTP,这是一个问题:

原始请求:

Remote Address:127.0.1.1:7171
Request URL:https://w-rli09-ben:7171/main/app/test
Request Method:GET
Status Code:302 Found

响应标题:

Content-Length:0
Date:Sat, 16 Jan 2016 01:02:11 GMT
Location:http://w-rli09-ben:7171/main/login
Server:Jetty(9.3.z-SNAPSHOT)

Jetty + Spring DEBUG日志:

2016-01-15 16:58:58 DEBUG o.e.j.s.session:347 - Scavenging sessions at 1452905938843
2016-01-15 16:58:58 DEBUG o.e.j.i.ManagedSelector:234 - Selector loop woken up from select, 1/1 selected
2016-01-15 16:58:58 DEBUG o.e.j.i.SelectChannelEndPoint:159 - onSelected 1->0 r=true w=false for SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14176/30000,SslConnection}{io=1/0,kio=1,kro=1}
2016-01-15 16:58:58 DEBUG o.e.j.i.SelectChannelEndPoint:186 - task SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14176/30000,SslConnection}{io=1/0,kio=1,kro=1}:runFillable
2016-01-15 16:58:58 DEBUG o.e.j.u.t.s.ExecuteProduceConsume:165 - EPR Prod/org.eclipse.jetty.io.ManagedSelector$SelectorProducer@6325da48 produced SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14176/30000,SslConnection}{io=1/0,kio=1,kro=1}:runFillable
2016-01-15 16:58:58 DEBUG o.e.j.u.t.s.ExecuteProduceConsume:206 - EPR Pend/org.eclipse.jetty.io.ManagedSelector$SelectorProducer@6325da48 dispatch
2016-01-15 16:58:58 DEBUG o.e.j.u.t.QueuedThreadPool:373 - queue EPR Pend/org.eclipse.jetty.io.ManagedSelector$SelectorProducer@6325da48
2016-01-15 16:58:58 DEBUG o.e.j.u.t.s.ExecuteProduceConsume:212 - EPR Pend/org.eclipse.jetty.io.ManagedSelector$SelectorProducer@6325da48 run SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14176/30000,SslConnection}{io=1/0,kio=1,kro=1}:runFillable
2016-01-15 16:58:58 DEBUG o.e.j.u.t.QueuedThreadPool:571 - run EPR Pend/org.eclipse.jetty.io.ManagedSelector$SelectorProducer@6325da48
2016-01-15 16:58:58 DEBUG o.e.j.u.t.s.ExecuteProduceConsume:125 - EPR Pend/org.eclipse.jetty.io.ManagedSelector$SelectorProducer@6325da48 run
2016-01-15 16:58:58 DEBUG o.e.j.u.t.s.ExecuteProduceConsume:154 - EPR Prod/org.eclipse.jetty.io.ManagedSelector$SelectorProducer@6325da48 produce enter
2016-01-15 16:58:58 DEBUG o.e.j.u.t.s.ExecuteProduceConsume:160 - EPR Prod/org.eclipse.jetty.io.ManagedSelector$SelectorProducer@6325da48 producing
2016-01-15 16:58:58 DEBUG o.e.j.i.FillInterest:93 - FillInterest@3cdb3cea{true,AC.ReadCB@19aa1a49{SslConnection@19aa1a49{NOT_HANDSHAKING,eio=-1/-1,di=-1} -> HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14177/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14176/30000,SslConnection}{io=1/0,kio=1,kro=1}][p=HttpParser{s=START,0 of -1},g=HttpGenerator@7a792b70{s=START},c=HttpChannelOverHttp@79c35e68{r=1,c=false,a=IDLE,uri=null}]}} fillable AC.ReadCB@19aa1a49{SslConnection@19aa1a49{NOT_HANDSHAKING,eio=-1/-1,di=-1} -> HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14178/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14177/30000,SslConnection}{io=1/0,kio=1,kro=1}][p=HttpParser{s=START,0 of -1},g=HttpGenerator@7a792b70{s=START},c=HttpChannelOverHttp@79c35e68{r=1,c=false,a=IDLE,uri=null}]}
2016-01-15 16:58:58 DEBUG o.e.j.i.SelectChannelEndPoint:214 - Key interests updated 1 -> 0 on SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14177/30000,SslConnection}{io=0/0,kio=0,kro=1}
2016-01-15 16:58:58 DEBUG o.e.j.i.s.SslConnection:184 - onFillable enter DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14178/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,14177/30000,SslConnection}{io=0/0,kio=0,kro=1}
2016-01-15 16:58:58 DEBUG o.e.j.i.ManagedSelector:231 - Selector loop waiting on select
2016-01-15 16:58:58 DEBUG o.e.j.i.FillInterest:93 - FillInterest@b5aba24{true,AC.ReadCB@67ba0184{HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14178/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,14177/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=START,0 of -1},g=HttpGenerator@7a792b70{s=START},c=HttpChannelOverHttp@79c35e68{r=1,c=false,a=IDLE,uri=null}]}} fillable AC.ReadCB@67ba0184{HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,FI,-,14178/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,14177/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=START,0 of -1},g=HttpGenerator@7a792b70{s=START},c=HttpChannelOverHttp@79c35e68{r=1,c=false,a=IDLE,uri=null}]}
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpConnection:215 - HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,-,-,14178/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,14177/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=START,0 of -1},g=HttpGenerator@7a792b70{s=START},c=HttpChannelOverHttp@79c35e68{r=1,c=false,a=IDLE,uri=null}] onFillable enter HttpChannelState@622e0999{s=IDLE a=null i=true r=!P!U w=false} null
2016-01-15 16:58:58 DEBUG o.e.j.i.ChannelEndPoint:147 - filled 501 SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,14178/30000,SslConnection}{io=0/0,kio=0,kro=1}
2016-01-15 16:58:58 DEBUG o.e.j.i.s.SslConnection:517 - SslConnection@19aa1a49{NOT_HANDSHAKING,eio=0/-1,di=-1} -> HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,-,-,14179/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,0/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=START,0 of -1},g=HttpGenerator@7a792b70{s=START},c=HttpChannelOverHttp@79c35e68{r=1,c=false,a=IDLE,uri=null}] net=501 unwrap Status = OK HandshakeStatus = NOT_HANDSHAKING bytesConsumed = 501 bytesProduced = 449
2016-01-15 16:58:58 DEBUG o.e.j.i.s.SslConnection:518 - SslConnection@19aa1a49{NOT_HANDSHAKING,eio=0/-1,di=-1} -> HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,-,-,14179/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,0/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=START,0 of -1},g=HttpGenerator@7a792b70{s=START},c=HttpChannelOverHttp@79c35e68{r=1,c=false,a=IDLE,uri=null}] filled b[449]=474554202F6D61696E2F6170702F7465737420485454502F31...3464380D0A0D0A
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpConnection:322 - HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,-,-,14180/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,1/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=START,0 of -1},g=HttpGenerator@7a792b70{s=START},c=HttpChannelOverHttp@79c35e68{r=1,c=false,a=IDLE,uri=null}] filled 449 HeapByteBuffer@3a5072bb[p=0,l=449,c=17408,r=449]={<<<GET /main/app/tes...ckog7sq64d8\r\n\r\n>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpConnection:339 - HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,-,-,14180/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,1/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=START,0 of -1},g=HttpGenerator@7a792b70{s=START},c=HttpChannelOverHttp@79c35e68{r=1,c=false,a=IDLE,uri=null}] parse HeapByteBuffer@3a5072bb[p=0,l=449,c=17408,r=449]={<<<GET /main/app/tes...ckog7sq64d8\r\n\r\n>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00} {}
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1163 - parseNext s=START HeapByteBuffer@3a5072bb[p=0,l=449,c=17408,r=449]={<<<GET /main/app/tes...ckog7sq64d8\r\n\r\n>>>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - START --> SPACE1
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - SPACE1 --> URI
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - URI --> SPACE2
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - SPACE2 --> REQUEST_VERSION
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - REQUEST_VERSION --> HEADER
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER --> HEADER_IN_VALUE
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER_IN_VALUE --> HEADER
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER --> HEADER_IN_VALUE
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER_IN_VALUE --> HEADER
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER --> HEADER_IN_VALUE
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER_IN_VALUE --> HEADER
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER --> HEADER_IN_NAME
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER_IN_NAME --> HEADER_VALUE
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER_VALUE --> HEADER_IN_VALUE
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER_IN_VALUE --> HEADER
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER --> HEADER_IN_VALUE
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER_IN_VALUE --> HEADER
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER --> HEADER_IN_VALUE
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER_IN_VALUE --> HEADER
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER --> HEADER_IN_VALUE
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER_IN_VALUE --> HEADER
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER --> HEADER_VALUE
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER_VALUE --> HEADER_IN_VALUE
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER_IN_VALUE --> HEADER
2016-01-15 16:58:58 DEBUG o.e.j.h.HttpParser:1542 - HEADER --> END
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpChannel:602 - HttpChannelOverHttp@79c35e68{r=2,c=false,a=IDLE,uri=//w-rli09-ben:7171/main/app/test} onRequestComplete
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpInput:385 - HttpInputOverHTTP@57be4401[c=0,s=STREAM] addContent EOF
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpConnection:344 - HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,-,-,14183/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,4/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=END,0 of -1},g=HttpGenerator@7a792b70{s=START},c=HttpChannelOverHttp@79c35e68{r=2,c=false,a=IDLE,uri=//w-rli09-ben:7171/main/app/test}] parsed true HttpParser{s=END,0 of -1}
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpConnection:192 - releaseRequestBuffer HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,-,-,14183/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,4/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=END,0 of -1},g=HttpGenerator@7a792b70{s=START},c=HttpChannelOverHttp@79c35e68{r=2,c=false,a=IDLE,uri=//w-rli09-ben:7171/main/app/test}]
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpChannel:271 - HttpChannelOverHttp@79c35e68{r=2,c=false,a=IDLE,uri=//w-rli09-ben:7171/main/app/test} handle //w-rli09-ben:7171/main/app/test 
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpChannelState:188 - HttpChannelState@622e0999{s=IDLE a=null i=true r=!P!U w=false} handling IDLE
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpChannel:284 - HttpChannelOverHttp@79c35e68{r=2,c=false,a=DISPATCHED,uri=//w-rli09-ben:7171/main/app/test} action DISPATCH
2016-01-15 16:58:58 DEBUG o.e.j.s.Server:506 - REQUEST on HttpChannelOverHttp@79c35e68{r=2,c=false,a=DISPATCHED,uri=//w-rli09-ben:7171/main/app/test}
GET //w-rli09-ben:7171/main/app/test
Host: w-rli09-ben:7171
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8,fr;q=0.6
Cookie: JSESSIONID=4nughxn0sfm01qckog7sq64d8


2016-01-15 16:58:58 DEBUG o.e.j.s.h.ContextHandler:1007 - scope null||/main/app/test @ o.e.j.w.WebAppContext@4d4d48a6{/main,file:///work/main/webapp/,AVAILABLE}{/tmp/main.war}
2016-01-15 16:58:58 DEBUG o.e.j.s.h.ContextHandler:1084 - context=/main||/app/test @ o.e.j.w.WebAppContext@4d4d48a6{/main,file:///work/main/webapp/,AVAILABLE}{/tmp/main.war}
2016-01-15 16:58:58 DEBUG o.e.j.s.session:271 - Got Session ID 4nughxn0sfm01qckog7sq64d8 from cookie
2016-01-15 16:58:58 DEBUG o.e.j.s.session:179 - sessionManager=org.eclipse.jetty.server.session.HashSessionManager@eadb475
2016-01-15 16:58:58 DEBUG o.e.j.s.session:180 - session=org.eclipse.jetty.server.session.HashedSession:4nughxn0sfm01qckog7sq64d8@465612300
2016-01-15 16:58:58 DEBUG o.e.j.s.ServletHandler:497 - servlet /main|/app|/test -> dashboard@c18aea94==org.springframework.web.servlet.DispatcherServlet,1,true
2016-01-15 16:58:58 DEBUG o.e.j.s.ServletHandler:560 - chain=filterChainProxy->springSecurityFilterChain->encoding-filter->httpMethodFilter->dashboard@c18aea94==org.springframework.web.servlet.DispatcherServlet,1,true
2016-01-15 16:58:58 DEBUG o.e.j.s.ServletHandler:1657 - call filter filterChainProxy
2016-01-15 16:58:58 DEBUG o.s.s.w.u.m.AntPathRequestMatcher:145 - Checking match of request : '/app/test'; against '/j_spring_security_check'
2016-01-15 16:58:58 DEBUG o.s.s.w.u.m.AntPathRequestMatcher:145 - Checking match of request : '/app/test'; against '/login'
2016-01-15 16:58:58 DEBUG o.s.s.w.u.m.AntPathRequestMatcher:145 - Checking match of request : '/app/test'; against '/autologin'
2016-01-15 16:58:58 DEBUG o.s.s.w.u.m.AntPathRequestMatcher:145 - Checking match of request : '/app/test'; against '/services/**/*'
2016-01-15 16:58:58 DEBUG o.s.s.w.u.m.AntPathRequestMatcher:145 - Checking match of request : '/app/test'; against '/logout'
2016-01-15 16:58:58 DEBUG o.s.s.w.u.m.AntPathRequestMatcher:145 - Checking match of request : '/app/test'; against '/app/settings/**/*'
2016-01-15 16:58:58 DEBUG o.s.s.w.u.m.AntPathRequestMatcher:145 - Checking match of request : '/app/test'; against '/app/**/*'
2016-01-15 16:58:58 DEBUG o.s.s.w.FilterChainProxy:337 - /app/test at position 1 of 7 in additional filter chain; firing Filter: 'TestSchemeFilter'
2016-01-15 16:58:58 INFO  c.r.l.ConsoleLogger:42 - [SYSOUT] !!! TestSchemeFilter !!!
2016-01-15 16:58:58 INFO  c.r.l.ConsoleLogger:42 - [SYSOUT] requesturl:http://w-rli09-ben:7171/main/app/test
2016-01-15 16:58:58 INFO  c.r.l.ConsoleLogger:42 - [SYSOUT] uri:/main/app/test
2016-01-15 16:58:58 INFO  c.r.l.ConsoleLogger:42 - [SYSOUT] prefix:http://w-rli09-ben:7171
2016-01-15 16:58:58 DEBUG o.s.s.w.FilterChainProxy:337 - /app/test at position 2 of 7 in additional filter chain; firing Filter: 'ExceptionFilter'
2016-01-15 16:58:58 DEBUG o.s.s.w.FilterChainProxy:337 - /app/test at position 3 of 7 in additional filter chain; firing Filter: 'RequestContextFilter'
2016-01-15 16:58:58 DEBUG o.s.s.w.FilterChainProxy:337 - /app/test at position 4 of 7 in additional filter chain; firing Filter: 'SessionRequiredFilter'
2016-01-15 16:58:58 INFO  c.r.l.ConsoleLogger:42 - [SYSOUT] Going originally to:/main/login
2016-01-15 16:58:58 INFO  c.r.l.ConsoleLogger:42 - [SYSOUT] Going to absolute url:http://w-rli09-ben:7171/main/login
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpChannel:703 - Commit HTTP/1.1{s=302,h=2} to HttpChannelOverHttp@79c35e68{r=2,c=true,a=DISPATCHED,uri=//w-rli09-ben:7171/main/app/test}
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpConnection:680 - org.eclipse.jetty.server.HttpConnection$SendCallback@a8c3680[PROCESSING][i=HTTP/1.1{s=302,h=2},cb=org.eclipse.jetty.server.HttpChannel$CommitCallback@7f44a2b4] generate: NEED_HEADER (null,[p=0,l=0,c=0,r=0],true)@START
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpConnection:680 - org.eclipse.jetty.server.HttpConnection$SendCallback@a8c3680[PROCESSING][i=HTTP/1.1{s=302,h=2},cb=org.eclipse.jetty.server.HttpChannel$CommitCallback@7f44a2b4] generate: FLUSH ([p=0,l=155,c=8192,r=155],[p=0,l=0,c=0,r=0],true)@COMPLETING
2016-01-15 16:58:58 DEBUG o.e.j.i.WriteFlusher:306 - write: WriteFlusher@35e7026b{IDLE} [HeapByteBuffer@6d84d4be[p=0,l=155,c=8192,r=155]={<<<HTTP/1.1 302 Foun...z-SNAPSHOT)\r\n\r\n>>>Jan 1970 00:00:00...\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00}]
2016-01-15 16:58:58 DEBUG o.e.j.i.WriteFlusher:117 - update WriteFlusher@35e7026b{WRITING}:IDLE-->WRITING
2016-01-15 16:58:58 DEBUG o.e.j.i.s.SslConnection:717 - SslConnection@19aa1a49{NOT_HANDSHAKING,eio=-1/-1,di=-1} -> HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,-,W,14188/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,9/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=END,0 of -1},g=HttpGenerator@7a792b70{s=COMPLETING},c=HttpChannelOverHttp@79c35e68{r=2,c=true,a=DISPATCHED,uri=//w-rli09-ben:7171/main/app/test}] flush b[155]=485454502F312E312033303220466F756E640D0A446174653A...4F54290D0A0D0A
2016-01-15 16:58:58 DEBUG o.e.j.i.s.SslConnection:748 - SslConnection@19aa1a49{NOT_HANDSHAKING,eio=-1/197,di=-1} -> HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,-,W,14189/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,10/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=END,0 of -1},g=HttpGenerator@7a792b70{s=COMPLETING},c=HttpChannelOverHttp@79c35e68{r=2,c=true,a=DISPATCHED,uri=//w-rli09-ben:7171/main/app/test}] wrap Status = OK HandshakeStatus = NOT_HANDSHAKING bytesConsumed = 155 bytesProduced = 197
2016-01-15 16:58:58 DEBUG o.e.j.i.s.SslConnection:786 - SslConnection@19aa1a49{NOT_HANDSHAKING,eio=-1/197,di=-1} -> HttpConnection@67ba0184[DecryptedEndPoint@5059b0eb{/127.0.0.1:56564<->7171,Open,in,out,-,W,14189/30000,HttpConnection}->SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,10/30000,SslConnection}{io=0/0,kio=0,kro=1}][p=HttpParser{s=END,0 of -1},g=HttpGenerator@7a792b70{s=COMPLETING},c=HttpChannelOverHttp@79c35e68{r=2,c=true,a=DISPATCHED,uri=//w-rli09-ben:7171/main/app/test}] wrap OK b[197]=17030300C0E7AA73C1224516237095A2349193DBED5E5E7363...A52FE4BE6C8EC7
2016-01-15 16:58:58 DEBUG o.e.j.i.ChannelEndPoint:193 - flushed 197 SelectChannelEndPoint@33c50677{/127.0.0.1:56564<->7171,Open,in,out,-,-,10/30000,SslConnection}{io=0/0,kio=0,kro=1}
2016-01-15 16:58:58 DEBUG o.e.j.i.WriteFlusher:423 - Flushed=true 155/155+0 WriteFlusher@35e7026b{WRITING}
2016-01-15 16:58:58 DEBUG o.e.j.i.WriteFlusher:117 - update WriteFlusher@35e7026b{IDLE}:WRITING-->IDLE
2016-01-15 16:58:58 DEBUG o.e.j.s.HttpConnection:680 - org.eclipse.jetty.server.HttpConnection$SendCallback@a8c3680[PROCESSING][i=HTTP/1.1{s=302,h=2},cb=org.eclipse.jetty.server.HttpChannel$CommitCallback@7f44a2b4] generate: DONE ([p=155,l=155,c=8192,r=0],[p=0,l=0,c=0,r=0],true)@END
2016-01-15 16:58:58 DEBUG o.e.j.s.Server:520 - RESPONSE for /main/app/test h=true
302 null
Date: Sat, 16 Jan 2016 00:58:58 GMT
Location: http://w-rli09-ben:7171/main/login

正如您所看到的,我在webapp中做的第一件事就是记录我从Jetty收到的请求信息,它已经在HTTP而不是HTTPS中。

我试着玩p:redirectHttp10Compatible,那里没有运气。

有些人说创建一个过滤器来修复重定向并使它们成为绝对的,但过滤器获取的请求已经有了错误的方案。

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

您在Jetty的SSL / TLS层中可能设置错误HttpConfiguration

该图层应包含SecureRequestCustomizer,以便来自SSL / TLS图层的信息可以正确地包含在HttpServletRequest个对象中。

信息如:

  • https
  • 的URI / URL方案
  • 此服务器实例的“安全端口号”是什么。
  • HttpServletRequest.isSecure()标志返回true
  • HttpServletRequest.getServerName()Host请求标头和VirtualHost图层)正确标识了任何SNI证书信息
  • javax.servlet.request.ssl_session_id Request属性(类型为String,自Servlet Spec 3.0起)
  • javax.servlet.request.cipher_suite请求属性(类型字符串)
  • javax.servlet.request.key_size请求属性(类型为整数)
  • javax.servlet.request.X509Certificate请求属性(类型java.security.cert.X509Certificate[])。这是X509Certificate类型的对象数组,此数组的顺序定义为信任的升序。链中的第一个证书是客户端设置的证书,下一个证书用于验证第一个证书,依此类推。